I have a trigger for "After saving a new post" and "After saving an updated post". The action is to send mail to my address. The mail subject begins with: "User: %username".
When a user (UserB) modifies a book page created by UserA, I receive a mail titled: "User: UserA".
The result of %username seems confusing now. What it actually stands for now is %authorname.
In my opinion, the expected behavior would be to receive a title "User: UserB" indicating it was UserB who triggered the event. I am not interested in the original author's name, only in who triggered this event.
If the placeholder %username is not available for indicating the currently active user triggering the event, could we have a different variable for this? ("%activeuser"). Anyway, there should be a clear separation between the two.
If nothing is done (code-wise) to this issue, at least the %username placeholder could be documented better so the admin knows not to expect the name of the triggering user.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | system_send_email_action.patch | 932 bytes | pancho |
Comments
Comment #1
cburschkaRelevant code is below. I agree that this should be changed, although it is up to Gabor whether it can still get into D6.
I propose to change this to: (no patch unless this goes through)
system_mail does not use $account anywhere else, so changing $account to be the user rather than the author does not make any other difference. I propose that in D7, both $author and $user variables become available; in DRUPAL-6 this would require string changes.
Comment #2
panchoEnclosed is an untested patch with the changes proposed by Arancaytar.
Comment #3
panchoMoving this to the D7 queue.
Comment #4
cburschkaThis patch still applies, but as I stated earlier, this should be improved since in D7 we can still change strings.
Comment #5
emok commentedSubscribing.
An option would also be to keep a token for the node author, in case someone wants to use that string. Something like this in
system_mail:Comment #6
yoroy commentedSeems relevant still
Comment #7
drupal_was_my_past commentedThis has been fixed in #113614: Add centralized token/placeholder substitution to core: Add centralized token/placeholder substitution to core.
Marking this as duplicate.