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.
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 CreditAttribution: askibinski commentedHere is a patch against 8.x according to the patch guidelines. Should be okay...
Comment #4
attiks CreditAttribution: 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 CreditAttribution: askibinski commentedWoops.... how did that get in there... sorry. Here is a reroll!
Comment #6
attiks CreditAttribution: attiks commentedLook better ;p
Comment #7
askibinski CreditAttribution: askibinski commentedRerolled the patch for the new core directory structure.
Comment #8
mariagwyn CreditAttribution: 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 CreditAttribution: peterx commented#7 works in D7.9 if you replace line 2742 instead of 2709.
Comment #10
Jelle_SWorks in D8
Comment #11
Dries CreditAttribution: Dries commentedCommitted to 7.x and 8.x. Thanks!