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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

moshe weitzman’s picture

looks reasonable to me.

RobRoy’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
2.27 KB

Here's a re-roll changing email to e-mail like core does. Looks good to me. RTBC

RobRoy’s picture

FileSize
2.27 KB

Whoops, wrong patch. This one is RTBC.

amitaibu’s picture

Subscribe. +any news about this patch?

greggles’s picture

Well, 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?

mooffie’s picture

Version: 5.x-1.5 » 5.x-1.x-dev
Assigned: gordon » Unassigned
Status: Reviewed & tested by the community » Needs work

Also, the only reason I wouldn't apply this is because user_load can be slow on some sites.

Yes, I think we should do direct SQL instead of user_load().

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?

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'.)

greggles’s picture

Version: 5.x-1.x-dev » 6.x-1.x-dev
Assigned: Unassigned » greggles
Status: Needs work » Needs review
FileSize
7.29 KB

Ok - 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.

greggles’s picture

Title: Add email tokens for nodes » Add email tokens for node author
Status: Needs review » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

missC’s picture

When 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!

greggles’s picture

Looking 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.

missC’s picture

OK, 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!