You can use tokens in the welcome emails available at admin/config/people/accounts/settings
Hoewever, when a token is empty it will be rendered as the actual token replacement string in the email.
For example:
Dear [user:field_firstname] [user:field_preposition] [user:field_lastname],
becomes this in the email:
Dear John [user:field_preposition] Doe,
This is because user.module does not use the "clear" option for the token_replace function as described here:
http://drupal.org/node/1272028
The patch attached adds this option to the function in user.module.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | user-token-replace-1300298-7.patch | 721 bytes | askibinski |
| #5 | user-token-replace-1300298-5.patch | 726 bytes | askibinski |
| #3 | user-token-replace-1300298-3.patch | 725 bytes | askibinski |
| token_replace_user_module.patch | 605 bytes | askibinski |
Comments
Comment #2
dave reidBugs have to be fixed in 8.x first, then backported to 7.x. I approve of this change, we just need a patch rolled with the correct format.
Comment #3
askibinski commentedHere is a patch against 8.x according to the patch guidelines. Should be okay...
Comment #4
attiks commentedComment says not to sanitize, but your code has 'sanitize' => TRUE, used to be FALSE, why the need to change it?
-10 days to next Drupal core point release.
Comment #5
askibinski commentedWoops.... how did that get in there... sorry. Here is a reroll!
Comment #6
attiks commentedLook better ;p
Comment #7
askibinski commentedRerolled the patch for the new core directory structure.
Comment #8
mariagwyn commentedDoes this need to be tested? I need this since I just discovered this problem and need to send a whole slew of emails to users who are about to be activated. I am rather hesitant to apply a patch to a core module on my site....
Comment #9
peterx commented#7 works in D7.9 if you replace line 2742 instead of 2709.
Comment #10
jelle_sWorks in D8
Comment #11
dries commentedCommitted to 7.x and 8.x. Thanks!