Hi,

Great module - Thanx, Thanx & Many more Thanx.

Just two quick questions:
(Im using actions & tokenised email & am able to email the creater of the node, but also want:

1. To send an email to the person flagging the node (i.e. I can't get the token for the flag creator's email id)

2. In the email to the admin, I want to say who flagged this node (i.e. I cant get the token for the flag creator's username)

Can someone please help me out with this.

Thanks

Comments

newdru08’s picture

Title: How to E-mail the flagging user » How to E-mail the flag creater
mooffie’s picture

Status: Active » Fixed

(Why did you change the title? It was correct.)

The flagging user is the user currently logged in. His tokens are listed under "Global tokens": [user-mail] and [user-name].

(BTW, our API (and the Rules support) allows to flag a node on behalf of somebody, and in this case this "somebody" isn't necessarily the currently logged in user. So when using the abomination known as "Drupal's Actions" there isn't really a reliable way to reach at the flagging user. Rules doesn't have this problem.)

newdru08’s picture

Thanks Mooffie,

The '%user-name' works & displays the name of the flagging user but unfortunately the '%user-mail' in the Reciepient doesnt send the email to the flagging user.

I need to be able to send an email upon flagging to 3 people - the admin, the node autor & the flagging user. Working out the first two was very easy, but I'm not able to send an email to the flagging user..... pl. help

mooffie’s picture

unfortunately the '%user-mail' in the Reciepient doesnt send [...]

(You didn't really use a percent sign, did you?)

You need to find out what this [user-mail] token expands to. Put it in the message body instead (and type a valid email in the 'recipient'), or embed it anywhere tokens are accepted (e.g., the "Display a tokenized message to the user" action) and see what it expands to.

newdru08’s picture

This is strange !! I put '%user-mail' in the email body & it translates nicely to the email id of the flagging user but when I put the same in the email 'Recipient' section it translates to '%user-mail@bedok.nswebhost.com' (i.e. %user-mail@mymailserver)

The same happens to the '%author', but the email works fine if i put in a proper email address such as me@gmail.com !!

mooffie’s picture

Why are you typing "%user-mail" instead of "[user-mail]" ?

Are you using Drupal's own "Send e-mail" action? You should use the "Send tokenized e-mail" action instead. I don't remember right now which module provides this for D5 (For D6, it's provided as part of the Token package). Let me know which module is that so I give it a quick look. Alternatively, file a bug against that module.

newdru08’s picture

"[user-mail]" does not generate anything - i tested it by putting it in the email body.

"%user-mail" generates the flagging users email id in the email body

Both fail to generate email to the flagging user

P.S. - Also, "%user-mail" is listed as an available token, not "[user-mail]"

mooffie’s picture

1. Which module is providing you with this email action? (If you don't know, disable your modules one by one till this action disappears.)

2. What's the action's exact title?

newdru08’s picture

Many Thanks Mooffie for walking me through this.

I will disable modules one by one until the token works & will update the thread on my findings.

The action's title is "Send tokened e-mail" & under the "Available Tokens" (under subhead 'Global tokens') are listed:
%user-name :The name of the currently logged in user.
%user-id : The user ID of the currently logged in user.
%user-mail : The email address of the currently logged in user.

My modules include (amongst several others:):
1. Actions
2. Actions Token E-mail
3. Flag
4. Flag Actions
5. Mass Contact
6. Notify
7. Token
8. User Registration Notification
9. Workflow
10. Workflow- Workflow NG Integration
11. Workflow Acces
12. Workflow NG
13. Workflow NG UI

quicksketch’s picture

The token-based e-mail that mooffie is referring to (and the most flexible) is the "Send tokenized e-mail" action, which is provided by Token Actions module (it's included with Token module). I'd suggest turning on that module and using that actions for sending e-mails.

newdru08’s picture

Thanks,

But (After extensive search) I cant find "send tokenized e-mail" or "Token Actions module" - are you sure these are part of 5.x

I've got 'Actions', 'Token' & 'Actions Token E-mail' modules that I'm using to "Send tokened e-mail" through 'Flag Actions'.

I must add here that '%author' in the recipient field has started sending mails to the node author but none of the following in the recipient field generate the mail to the flagging user:
[user-mail]
%user-mail

Although, in the body field & subject line '%user-mail' reveals the flagging users email id.

Also, all other tokens listed in the "Send tokened e-mail" work fine.

I'm able to send out an email as long as the address in the recipient bar in entered as a static email id (e.g. yahoo@gmail.com) or is entered as '%author'

If '%user-mail' is the wrong token for the flagging user, then why does this same token work fine in the subject line and the body fields.

Please help - I really need to email the flagging user.

mooffie’s picture

You're using the Actions token email module.

I'm able to send out an email as long as the address in the recipient bar in entered as a static email [...] or is entered as '%author'

Yes, that's all that module is capable of.

AFAICS, you have three options:

1. File a 'feature' issue against that module ('Actions token email'), asking to enable tokens in the 'recipient' field.

But (After extensive search) I cant find "send tokenized e-mail" or "Token actions" module - are you sure these are part of 5.x

2. (They're only provided in the D6 package.) File an issue against the Token module, asking: 1. Why its 'Token actions' sub-module is only shipped with the D6 version of the package; 2. Whether this 'Token actions' sub-module is compatible with D5.

3. Find some other module that provides a tokenized e-mail action for D5.

newdru08’s picture

Thanks.

Is there ANY way that Flag may be used in D5 to send an e-mail to the person flagging the node ?

quicksketch’s picture

newdru08, Mooffie listed your three options in #12. I think he's offered enough time explaining the options. I'd think both #1 and #2 are good options he's put forth.

newdru08’s picture

Thanks

done #1: http://drupal.org/node/336733
&
#2: http://drupal.org/node/336739
&
Tried looking for #3 - but unable to find any such modules for D5

I'll close the issue here now & will update the feedback from the issues reported at Token & Action Token e-mail modules.

newdru08’s picture

Status: Fixed » Closed (fixed)