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.
I'm send out a tokenized email triggered by a user's profile being updated.
This is what I'm getting:
User: [account:user] has been updated. Email: [account:mail]
[account:account-edit]
[account-url]
Nothing expands to the value.
Any ideas?
Richard S Albrecht
Comment | File | Size | Author |
---|---|---|---|
#56 | 635570-token-actions-user-context.patch | 17.81 KB | Dave Reid |
#55 | 635570-token-actions-user-context.patch | 13.79 KB | Dave Reid |
#35 | user_actions.patch | 474 bytes | yan |
Comments
Comment #1
Hawkcode CreditAttribution: Hawkcode commentedComment #2
spgd01 CreditAttribution: spgd01 commentedI have the same problem. I have posted literaly every token listed http://drupal.org/node/390482 and only the ones relating to my web site show:
[site-url] The url of the current Drupal website.
[site-name] The name of the current Drupal website.
[site-slogan] The slogan of the current Drupal website.
[site-mission] The mission of the current Drupal website.
[site-mail] The contact email address for the current Drupal website.
None of the user tokens work
Comment #3
Hawkcode CreditAttribution: Hawkcode commentedSame tokens work for me too.
So what does one due if he can't figure it out?
There has to be someone that can help us???
I'm on 6.12 what are you on?
Comment #4
Hawkcode CreditAttribution: Hawkcode commentedI just tried the same tokenised email - with all the tokens and a fair amount of them worked for updating a node.
They Don't work for updating a user.
A little more info.
Rich
Comment #5
stevelack CreditAttribution: stevelack commentedI'm having the same issue. None of the User tokens work in an email sent via an action that is triggered when a new user registers. The global tokens seem to work but not the user tokens.
Anybody have any idea how to fix this?
Comment #6
spgd01 CreditAttribution: spgd01 commentedI am still having the same issue. When a trigger action sends an e-mail because of a new user I do not receive any user token info in the e-mail. I only see the actual token: [user] Does anyone have any solutions? Is anyone looking into this?
Comment #7
Alan.Guggenheim CreditAttribution: Alan.Guggenheim commentedSame thing here. I am trying to send emails following user registration, and tokens are not expanded.
I also need to use tokens from CiviCRM for emails. What is the proper syntax? In views, I can see the CiviCRM fields, including custom fields.
Thanks
Comment #8
Alan.Guggenheim CreditAttribution: Alan.Guggenheim commentedSame problem Drupal 6.15 and Token 6.x-1.12
Comment #9
Dave ReidThis isn't really critical, but it needs to be documented that the token action e-mails don't support non-global tokens because the mails aren't provided any kind of 'context'.
Comment #10
Alan.Guggenheim CreditAttribution: Alan.Guggenheim commentedNo, I think it is a bug and can be fixed. It has been fixed, for example in http://drupal.org/node/329267
Send tokenized email to members of a role
It is very important to be able to do this in workflow, processing new, changed, deleted users,...
Comment #11
Alan.Guggenheim CreditAttribution: Alan.Guggenheim commentedComment #12
xqbzzr CreditAttribution: xqbzzr commentedSame here with rules and emails.
Comment #13
Alan.Guggenheim CreditAttribution: Alan.Guggenheim commentedComment #14
robby.smith CreditAttribution: robby.smith commentedsubscribing
Comment #15
Jim Ruby CreditAttribution: Jim Ruby commentedsubscribing
Comment #16
Alan.Guggenheim CreditAttribution: Alan.Guggenheim commentedI changed the title and the priority, as this is critical for my operation: I need to send an email to several people upon a new user registration, with that user information (name, email, address, and other fields).
For some reaso these tokens are not properly expanded. It seems to be a context issue, but I am not able to find out where is the bug.
Help,...
Comment #17
Rob T CreditAttribution: Rob T commentedI need the same type of functionality. Truth be told, I am shocked this wasn't already a feature of the module.
Comment #18
Alan.Guggenheim CreditAttribution: Alan.Guggenheim commentedI think it is a feature, there is no indication that it would not work. There is a bug, apparently, the contaxt is not properly updated/read when a new user is created, but nobody seems to be looking into it.
Comment #19
xqbzzr CreditAttribution: xqbzzr commentedAhm, Ive had the same issue. At least I thought i had. BUT - I double checked all the tokens and found out that there are some differences in how to use the tokens depending on the modules providing them.
For example when using the "Send email to external adress" I have to use the [node:author-name-raw] and [user:user-raw] tokens. When sending the exact same "mail to a User-Reference Field" from this node, the tokens will not work. Instead I have to use the [author-name-raw] and [user-raw] tokens (without the "node:"). I looked into most of my tokens and could fix nearly every issue just by keeping the right syntax.
Is that of any help?
Comment #20
Alan.Guggenheim CreditAttribution: Alan.Guggenheim commentedThanks, but what I need to do is send an email upon user registration and I looked, and I did not find any other token that works.
Comment #21
yan CreditAttribution: yan commentedSame here: I want to send the data of a newly registered user and the tokens don't work. I don't see any [account: ...] or [user: ...] tokens, though.
Comment #22
tmetzger CreditAttribution: tmetzger commentedBit of a pain! Did it ever work? Subscribing.
Comment #23
Alan.Guggenheim CreditAttribution: Alan.Guggenheim commentedNot working so fasr in tokens/Actions
Some limited working tokens through rules: Send a mail to all users of a role
[account:user] [account:uid] [account:mail] [account:reg-date]
Very frustrating.
Comment #24
kfurlotte CreditAttribution: kfurlotte commentedsubscribing
Comment #25
bryancasler CreditAttribution: bryancasler commentedsubscribe
Comment #26
locomo CreditAttribution: locomo commentedsubscribe
Comment #27
venusrising CreditAttribution: venusrising commentedSame issue here. There is a huge list of tokes but I can only get %username $site_name %node %title to work. Nothing in brackets works at all.
Comment #28
ATB CreditAttribution: ATB commentedHaving the same problem. I need to send an email upon user registration to 2 admins, and have them look at the account and decide, based on info in the form, whether they should have certain types of access. None of the user tokens expand.
Comment #29
quex CreditAttribution: quex commentedI have found solution to send token values for user actions in e-mails. In function
token_normalize_context()
put this:It works for all actions ('view', 'insert', 'update', 'delete', 'login') in user hook!
Comment #30
venusrising CreditAttribution: venusrising commentedquex can you clarify, I just wanted an email that would let me know when a new user registered(which I have working ) but I want a link to the name date and user profile link and cannot get it to work. Thanks for your reply.
Comment #31
quex CreditAttribution: quex commented@venusrising:
At first add token action in admin/settings/actions with this content:
Next you need add trigger, go to admin/build/trigger/user and select you token action from list.
It's very simple and it works for me :-) You just need apply my solution posted in earlier comment.
Comment #32
keithmorr CreditAttribution: keithmorr commentedquex,
can you clarify where the file is that contains token_normalize_context() so that I may apply this fix?
I am in Drupal 5.
Thank You
Comment #33
quex CreditAttribution: quex commentedWell, i'm using drupal 6.
In drupal 6 it's in token_actions.module file,
token_normalize_context()
function.Sorry, i cannot help you with drupal 5.
Comment #34
ShutterFreak CreditAttribution: ShutterFreak commentedSubscribing, and very curious to know whether #29 will make it in CVS.
Comment #35
yan CreditAttribution: yan commentedHere's #29 as a patch, but I haven't tested it.
Comment #36
rkdesantos CreditAttribution: rkdesantos commentedsubscribing
Comment #37
rkdesantos CreditAttribution: rkdesantos commentedI applied the patch manually to the latest version of token_actions.module (v 1.4.2.9 2010/03/25 17:49:43) with the current 6.x-1.14 version of the rest of the module and no success.
Comment #38
Dave ReidComment #39
MisterBigs CreditAttribution: MisterBigs commentedHi,
I think I'm having the same problem. I am using this in a tokenized email [example-contact] where I've implemented the example_token_values and example_token_list in my module. My module has a form, created with the form api, that gets stored in a custom table. My token are listed when I view all available token so I know that example_token_list is working but when example_token_values is called $type doesn't come up as equal to 'example'.
I need to pull information from the submitted form and display them on the tokenized email that is sent out. Am I missing a function? The Trigger I created is working and fires when the form is submitted and the Action is sending out the email the problem is that the tokens are not being replace with the form's values.
I'm running 6.x-1.14
Comment #40
bryancasler CreditAttribution: bryancasler commentedI'm running token version = "6.x-1.12" with the patch from #35 and everything is working for me. Been using it for a while now with no problems.
Comment #41
ayalsule CreditAttribution: ayalsule commentedsubscribe
Comment #42
jpamental CreditAttribution: jpamental commentedJust chiming in that with token 6.x-1.13, applying the patch from #35 above cleared up the same issue for me (user tokens not evaluating)
Jason
Comment #43
MisterBigs CreditAttribution: MisterBigs commentedI applied the patch on #35 and it still did not work.
Comment #44
jpamental CreditAttribution: jpamental commentedThe bug seems to still exist in 6.x-1.14 - but the patch from #35 still works perfectly. (that's with all other modules up-to-date, core 6.19 installed)
Comment #45
riisi CreditAttribution: riisi commentedApplied #29 to the location per #33. It works!
For anyone else looking for a similar solution, I wanted to use the VBO 'send tokenized e-mail' action to send emails to users with their recorded profile details (address, phone no. etc) so that they can check. Installing Token Profile (http://drupal.org/project/token_profile) provides user profile tokens which now work with the above patch.
Comment #46
shady_gun CreditAttribution: shady_gun commentedsame problem here .. i can't get the cck tokens to work with the tokenized mail .....
subscribing
Comment #47
vgeck CreditAttribution: vgeck commentedSubscribing.
Comment #48
ndwilliams3 CreditAttribution: ndwilliams3 commentedconfirming that patch also worked for me against core 6.19 and token 6.x-1.14 and token_profile 6.x-1.0-beta1.
Comment #49
MaffooClock CreditAttribution: MaffooClock commentedI can confirm that the patch in #35 worked for me (Drupal 6.19, Token 6.x-1.14).
I had an action to send me an email when a new user account was created, but none of the tokens were replaced.
After applying the patch, the email above was correctly populated.
Comment #50
brisath CreditAttribution: brisath commentedsubscribing
Comment #51
venusrising CreditAttribution: venusrising commentedI applied the patch so some stuff works now
I have an email to let us know when new content is created and so far it works with on exception Okay this is weird not sure how to get this event to trigger after pathauto so the url is pathuto friendly.
Hello [site-name]-
[author-name] [account-url] submitted a new [type-name] "[title]"
[node-url] on [small].
This all works but upon creation it will only send the none url friendly alias for node URL. If I have this rule trigger for updates and creation it will send the friendly url for an update.
Comment #52
pumpkinkid CreditAttribution: pumpkinkid commentedHaving same problems... I applied the patch to 6x-1.14 and it did not work...
Comment #53
pumpkinkid CreditAttribution: pumpkinkid commentedActually, it seems as before the patch was not properly applied... I re-patched the module on my site and it is now working as expected.
Comment #54
jweedman CreditAttribution: jweedman commentedBased on #40, #42, #44, #45, #48, #49, #51, #53, and my own experience (#54), this little patch is doing the trick.
Hopefully we see this issue resolved in the next release. In the meantime, thanks @quex & @yan for the code and patch. Works great. Changing Status to reviewed & tested. I'll leave the patch porting to those who created the patch.
Everyone looking for an answer check comments #29 & #33 for a manual fix, and #35 for a patch of the same solution.
Comment #55
Dave ReidFormal patch against 6.x-1.x with improved tests for review.
Comment #56
Dave ReidRevised patch with a little less unnecessary changes.
Comment #57
Dave ReidTest bot likes it, and I tested it myself as well. Committed #56 to CVS! Thanks everyone!
http://drupal.org/cvs?commit=452406
Comment #59
haggins CreditAttribution: haggins commentedI'm using latest dev but still have problems. This is the (tokenized) mail I receive:
As you see none of the tokens haven been replaced with its value. Are there others also having this issue?
edit: only "comment" and "global" token categories have blue background and are working.
Comment #60
haggins CreditAttribution: haggins commentedIt's working when I use rules-module instead of triggers.
Comment #61
verta CreditAttribution: verta commentedsubscribing
Also following: #298683: Tokens are not evaluated
http://drupal.org/node/298683 says there is a -dev release to fix this.
Comment #62
spgd01 CreditAttribution: spgd01 commentedI am still have the issue with all the latest releases of token.
i take it back all is working now. Thank you.
Comment #63
portulacaThank you for the fix!
The 2011-Feb-25 dev build works for me now, I tested all of the user tokens on the "profile updated" trigger.