as a followup to adding settings to notify users on account status changes, and to potentially pave the way for email users upon change of role, i've been thinking more about this UI. what if an admin both approves a user and puts them in some new roles? they shouldn't get 2 different emails. instead of different settings for each possible change to the status, we only need 4 template settings:
- user created by admin
- user registered herself, no approval required
- user registered herself, pending approval
- user account changed
there would be additional admin settings that defined template paragraphs that could be conditionally loaded into any of (therefore shared among) these overall message templates. for example, there might be the following paragraphs defined:
- !p_active
- !p_deleted
- !p_blocked
- !p_roles_added
- !p_roles_removed
- !p_temp_login
each token would have a value if the changed happened, or would be removed if the status didn't match or there was no change of roles, etc. if a new 1-time login link was made, !p_temp_login would be a paragraph that describes how to use the login link. !p_temp_login could be shared among the password reset, account approved by admin, and new account registration messages, for example...
to define each of these paragraphs, you'd have access to specific tokens. in addition to the existing tokens, there might be others like:
- !roles_current
- comma separated list of the user's current roles
- !roles_added
- list of the roles added to the account
- !roles_removed
- roles removed from the account
- !status_current
- "active", "blocked", (it'd be nice if we had "pending" in here as a distinct status, but that's for another patch).
then, the default value of the "user account changed" message body would be something like:
!username,
!p_active
!p_temp_login
!p_roles_added
!p_roles_removed
!p_blocked
-- !site team
that way, if an admin approves an account and adds some roles, the user gets 1 email that might look something like:
dww,
Your account at baterialucha.org is now active.
You may now log in by clicking on this link or copying and pasting it in your browser:
!login_url
This is a one-time login, so it can be used only once. After logging in, you will be redirected to !edit_uri so you can change your password.
This site has different kinds of users based on the roles they play, with varying levels of permission and access. You have been added to the following user roles: band member, organizer, administrator.
the template for accounts created by the admin would be something like:
<code>
!username,
An administrator has created an account for you at !site.
!p_temp_login
!p_roles_added
-- !site team
if the site doesn't care about separately worded paragraphs for each possible status change, they could just use this for the start of their "user account changed" message body:
!username,
Your account at !site is now !current_status.
...
open questions:
- maybe we want to keep the password reset as its own message template, so you can customize the introduction before the !p_temp_login, or perhaps we just need another conditional account change token like !p_password_reset_requested.
- are we going to get screwed with tokens inside of tokens? seems like we're going to have pass the message templates through the token translation recursively, until no more tokens are matched and replaced. or, perhaps we want different symbols at the front of the different kinds of tokens, and they get replaced in a fixed order? that seems more ugly and inflexible to me.
- do people think this is too confusing and complicated a UI for end-user admins to grasp and configured properly?
- should we provide a UI for site admins to define their own new paragraph tokens if they wanted to insert
shared text into all of the messages? (a shared site-specific signature, for example)
Comments
Comment #1
michelleI really like the idea over all. For your questions:
1) I think differentiating between a password request and a new account one time log in is a good idea.
2) I don't know enough about the internals to answer this one.
3) I don't think it's confusing if you have a list of tokens available and what they mean. I don't think the whole replacement idea is complex and should be fine.
4) I think this is probably over kill... There's not going to be _that_ many different messages so they can copy and paste if they want something in all of them.
Michelle
Comment #2
dpearcefl commentedIs there any interest in pursuing this issue? Meaning is any one interested to roll a patch?
Comment #3
michelleI don't know if this is still useful but we're well past getting FRs into D6. :)
Michelle
Comment #4
dpearcefl commentedWithout a patch, the issue perishes...
Comment #5
dwwYeah, sorry, I have no time to push this forward. If anyone else wants to run with it, go for it. ;)
Comment #18
smustgrave commentedWonder after so many years if this is still needed?
Comment #20
quietone commentedAnother two years and there is no discussion or support for this idea.
The proposal doesn't met the Criteria for evaluating proposed changes. In this case, there is not demonstrated demand and support for the change.
If there is interest in this re-open the issue and add a comment. Or open a new issue and reference this one.