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.
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.
Comment | File | Size | Author |
---|---|---|---|
template_token.patch | 1.12 KB | verot |
Comments
Comment #1
franzCommited on dev (release will be available midnight)
Seems to be working, mind to test it?
Comment #3
roball CreditAttribution: roball commentedDoesn'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.
Comment #4
deggertsen CreditAttribution: deggertsen commentedThis 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!
Comment #5
szantog CreditAttribution: szantog commentedThe 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.
Comment #6
franzI think it is because de dev is not them same branch as HEAD.
Comment #7
yngens CreditAttribution: yngens commentedsubscribing. i also need this.