Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Here is a patch which adds tokens which exposes the users email address as a token.
So you can get the email of the owner and the email of the a user reference field.
Comment | File | Size | Author |
---|---|---|---|
#7 | 126423_token_node_author_mail.patch | 7.29 KB | greggles |
#3 | author.mail__0.patch | 2.27 KB | RobRoy |
#2 | author.mail_.patch | 2.27 KB | RobRoy |
token_email.patch | 2.67 KB | gordon | |
Comments
Comment #1
moshe weitzman CreditAttribution: moshe weitzman commentedlooks reasonable to me.
Comment #2
RobRoy CreditAttribution: RobRoy commentedHere's a re-roll changing email to e-mail like core does. Looks good to me. RTBC
Comment #3
RobRoy CreditAttribution: RobRoy commentedWhoops, wrong patch. This one is RTBC.
Comment #4
amitaibuSubscribe. +any news about this patch?
Comment #5
gregglesWell, it doesn't apply any more, but I re-rolled it on my testing sites and assuming nothing blows up I'll commit it because I mostly like the idea.
One question for RobRoy or anyone who knows, the author-name and author-uid tokens were changed as part of this to point to the recently loaded $account object equivalents of the $node object items. Why?
Also, the only reason I wouldn't apply this is because user_load can be slow on some sites. But it's rarely all that slow, right?
Comment #6
mooffie CreditAttribution: mooffie commentedYes, I think we should do direct SQL instead of user_load().
I too don't see why it was necessary. (Perhaps to give modules a chance to overwrite 'name'? but it's not really convincing.)
('Twas a long time ago, so I'm changing to 'unassigned'.)
Comment #7
gregglesOk - here's a new version. I got rid of the cck bits because that's now in cck itself. I used a simple query instead of a user load. And I reformatted a little bit of the node_token_list because it was crazy.
Comment #8
gregglesCommitted to both
5.x http://drupal.org/cvs?commit=128399
6.x http://drupal.org/cvs?commit=128398
Comment #9
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #10
missC CreditAttribution: missC commentedWhen you say this has been committed to 5.x http://drupal.org/cvs?commit=128399, does that mean it should be available in the current version (5.x-1.11 2008-Apr-28)? I am not seeing it there, but then, maybe I am misunderstanding...
I am looking for a way to reference the email address of a user selected in a cck user reference field. My objective is to trigger an email to the newly selected user (using workflow-ng) when the selection is changed. Is that what this is supposed to support? I thought it might be given the description, "so you can get the email ... of the a user reference field," but I don't see a token for it in the replacement patterns.
Thanks!
Comment #11
gregglesLooking at Revision 1.3.2.26 you can see that there has not been a tag to create an official branch since that commit to the DRUPAL-5 branch. So, this is only available to 5.x-1.x-dev
It's probably time for another official release from the 5.x branch of code. It would be helpful if you could test out the 5.x-1.x-dev and report any problems you find.
Comment #12
missC CreditAttribution: missC commentedOK, I am trying to test this out, but I don't see the token there. Maybe there is a bug, maybe I just installed incorrectly. I am not sure. I did enter a bug ticket, though: http://drupal.org/node/303718
Thanks!