When you use tokens in the header or footer, for instance !newsletter_url, the tokens are not replaced.

The mail_alter hook in the module calls a function which adds the header and footer to the email generated by simplenews. The patch simply loads the tokens at that time, and filters the header and footer with the tokens array.

CommentFileSizeAuthor
template_token.patch1.12 KBverot
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

franz’s picture

Status: Patch (to be ported) » Fixed

Commited on dev (release will be available midnight)

Seems to be working, mind to test it?

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

roball’s picture

Version: 6.x-1.0-beta2 » 6.x-1.x-dev
Status: Closed (fixed) » Active

Doesn't work with Simplenews 6.x-2.x which is the version new features are getting in. See #640740: Still using function simplenews_mail_tokens() instead of token module.

deggertsen’s picture

This seems to be a fairly important issue. I would think that most people would want the unsubscribe link to show up in their email footer but with the current beta release the unsubscribe link it broken when used in the footer. Maybe I'm misunderstanding and there's a better way to accomplish this but this should probably be taken care of...

Thanks!

szantog’s picture

Version: 6.x-1.x-dev » 6.x-1.0-beta3
Category: feature » bug
Status: Active » Needs review

The line
$variables = simplenews_mail_tokens($user, $message['params']['context'], $language);
need to change
$variables = simplenews_mail_tokens($message['params']['context']['account'], $message['params']['context'], $language);

I tried to made patch on the version from HEAD, but i saw this is completly rewritten.

franz’s picture

I think it is because de dev is not them same branch as HEAD.

yngens’s picture

subscribing. i also need this.