I got a request via e-mail to provide support in autoresponder for tokens from the token module.

If you have any questions on how to implement token please let me know. There is a video of a presentation I gave on the topic http://dc2009.drupalcon.org/session/token-little-api-could and also the token API.txt has some good advice.

Comments

keyzo’s picture

Hi,

Good video, I have the same problem where I want to include the Username within emails of the people who has subscribed to the autoresponder module.

Is this possible? I've tried several things but I can't seem to get it working, does anybody have an advise to help me?

Much Appreciated.

Shane

keyzo’s picture

Status: Active » Closed (fixed)

Along with the help of a great guy on StackOverflow.com we managed to solve my issues here is the article
http://stackoverflow.com/questions/3032807/drupal-autoresponder-with-tok...

This was the final solution;

Token replacement in the autoresponder_mail() function by inserting the following code before the preparation of the plain text body (before line 392 in the 6.x-1.0-alpha1 release):

// load the full user object
$user = user_load(array('mail' => $u->mail));
// Replace user tokens in mail body
$mail->body = token_replace($mail->body, 'user', $user);

Thanks for the help Henrik!

Shane

greggles’s picture

Thanks for your comment and for helping make this a better module. Could you provide this as a patch?