Posted by shermann on March 25, 2009 at 3:45pm
Hi,
first of all, thanks for this nifty little module for Drupal.
One question which wasn't answered by reading the documentation:
Rules can use the "Token" module to tokenize some data in some areas.
What I'm missing (actually tried out, but didn't work) is the usage of "Token" for eMail sending.
I'm using also the workflow module and there I can use the "Send tokenized mail ..." action, but I couldn't find anything for the "Rules" module.
Do I miss something or it's just not implemented right now?
Regards,
\sh
Comments
faq
Check the faq entry about token: http://groups.drupal.org/node/10270/faq
That doesn't help ;)
Hi Fago,
I already read the faq...but the question is more:
How do you replace the "send tokenized email..." action with rules.
I read some bug reports from rules, and someone mentioned "Use the -dev token module"...I tried and some of the tokens are replaced in plain "send email to user" action, but not all.
e.G. [node:title] works [node:author-mail] works, but [user] (which should give the logged in username) doesn't.
I played about with different notations, because some of them are mentioned in the issue area.
[user-name] doesn't work, [user:name] neither...So I'm a bit stucked.
Which notation and what tokens are available...after a content-node is being e.g. updated.
Regards,
\sh
Dear \sh
You need to play around much more....
[user:user] is the right way to achieve your goal.
Kind regards,
\sh ;)
Tokenized Email option not appearing
I would appreciate it if someone would tell me how to get the "Send a Tokenized Mail" option. I have Rules 6.x-1.0-beta5 installed. I have Token 6.x-1.11 installed. I have disabled Token actions (per the FAQ at http://groups.drupal.org/node/10270/faq#missing-token-module).
When I attempt to add an action to a rule, the only options pertaining to email that I see are:
- Send a mail to a user
- Send a mail to all users of a role
- Send a mail to an arbitrary mail address
I've tried using the Send a mail to a user option with token placeholders listed in the email, but the email comes back to me exactly as written without replacing the tokens with their respective values. For example:
Node:
[nid]
[type]
[type-name]
[title]
[author-uid]
[author-name]
[author-mail]
[node:workflow-old-state-name]
[node:workflow-current-state-name]
The reason I'm trying to do this is to figure out what the values are for [node:workflow-old-state-name] and [node:workflow-current-state-name], because when I try to do a Rules check on a Textual comparison of [node:workflow-current-state-name] to either (creation) or Draft (a workflow state I put in place), it always evals to false.
Thank you for any information!
Resolution
Strike that - I (finally) found the answer. So just in case anyone else has been as confused as I - The problem is that I was "send tokenized mail" isn't a default option in Rules. You have to create an advanced action via Actions first. I assumed that since I could create a custom email action within Rules by default, that I must be missing a module installation for "send tokenized mail" to show up as an action under Rules.
UI improvement suggestion: Since we can create standard emails by default in Rules, it makes a lot more sense to me to make "send tokenized mail" available by default as well.
question is ongoing
I read your resolution very carefully severel times but I was not able to get 'send tokenized mail' under rules to work.
I created a advanced action "X" with type "send tokenized mail" via Actions and saved it.
I created a new rule under triggered rules. Under rule element I choose Add an Action.
But the new created advanced action "X" is not available under Select an action to add.
did I something wrong? any other help?
Thx
I solved it for me
after following the Install notes on http://drupal.org/project/rules and installing Development snapshots of http://drupal.org/project/token I am now able to send tokenized emails.
@HoKe
Can I clarify what you did please, as I am having a similar issue (along with this one http://groups.drupal.org/node/23023 )
I can't select the tokenised email that I created in Actions, from the Rules 'Add an Action' drop-down.
You said that you solved your issue by "following the Install notes on http://drupal.org/project/rules and installing Development snapshots of http://drupal.org/project/token".
I did upgrade Token to 6.x-1.12.
Token Actions is unchecked.
Any other tips please?
Getting somewhere perhaps?
I found when I was re-editing the Rule that there are now a whole lot of tokens in 3 accordian menu's under the "Send an email to an arbitrary mail address" so added a few of these to the body of the email area. It would appear that I needn't have worried about being able to select the 'Action' that I had created using the core module nor finding the specific phrase "Send tokenised email".
When I trialled the Rule though it didn't fire as expected - so I learned another thing - adding a comment to a STORM note is not the event:"After saving new content", although posting a note is.
Hmmm....?
Same problem here
I'm using the following modules Token versions 6.x-1.x-dev (Token Actions is turned off per this post) and Rules 6.x-1.2. But I don't see the "Send tokenized e-mail" action. I checked, token_actions.module does have the action. The tokens themselves do show up when creating a rule. But the most important action I need is "Send tokenized e-mail".
Does anyone have any further ideas on this?
Go for regular e-mail?
If you use the regular 'send e-mail to a user' or 'send e-mail to an arbitrary address' action you can use the tokens -- so there is little need for an explicit 'send tokenized e-mail' action.
If I understand Rules correctly, each action that should be visible to Rules must have some particular information exposed. Probably noone bothered to make the 'send tokenized e-mail' action visible to Rules, since it is not necessary.
Please post again if I misunderstood your needs.
Good luck!
//Johan Falk, NodeOne, Sweden
Tokens, Rules and cron
Hey Johan (and whoelse that knows the solution to this ;)
I've been having a problem with the "send e-mail to a user" action and tokens, and in the search for a solution i've stumbled upon a lot of your replies and you seem to know what your talking about.
I use Scheduler to unpublish a node after a certain timespan and i've created a rule that sends out an e-mail to the author of the node when it gets unpublished. The smart thing (i thought) was to get tokens to show the node title, the node url etc. in the e-mail to properly inform the author of what item that has been unpublished.
The thing is that when i use the "send e-mail to a user" action WITHOUT tokens there's no problems sending the mail to the author after running cron, but when i use tokens (eg. [node:title]) and i run the cron job, cron fails (timeout) and it can't send the e-mail.
When i use the user argument instead of the content argument i've no problems with getting the e-mail with tokens sent. But the tokens for the user argument is pretty much irrelevant in this case.
Do you or anyone know the fix for this annoying problem?
Thanks