The email subject token '[[simplenews-category:name]] ' is not being replaced. I'm not sure if there is a change in how the token module handles things in D7 but I believe it's the double brackets that are killing it.

The switch on line 2571 of simplenews.module is receiving '[simplenews-category:name' (without quotes) so it's never finding a match. I adjusted the string on line 418 of the install file to only use 1 set of square brackets and it works fine.

So line 418:

 $category->email_subject  ='[[simplenews-category:name]] [node:title]';

became this:

 $category->email_subject  ='[simplenews-category:name] [node:title]';

Note: this is duplicated in update 7000 on line 900 too.

Can anyone shed some light on this? Or is it just some legacy d6 code that needs fixing?

Also, while I'm here…

Is there a reason that the email subject is hardcoded in the install file like this?

It would be a lot better if it was in a theme function or at least override-able in a template or something. I know that it's possible to override it in a hook_mail_alter() but it would be great if it could be done in a place where all of the nice simplenews vars were available.

If there's no other critical reason that this wouldn't be possible I will open a feature request for it.

Thanks

Comments

miro_dietiker’s picture

Status: Active » Closed (duplicate)

This issue is pending - token parser issue in drupal core.
#733192: Tokens enclosed in [ ] are not recognized

clemens.tolboom’s picture

Status: Closed (duplicate) » Active

I'm not sure what the duplicate issue is. As #733192: Tokens enclosed in [ ] are not recognized is now fixed I'd love to close that duplicate issue :)

miro_dietiker’s picture

Please test with latest D7. I'd expect things will work without any update needed... Is it?

Simon Georges’s picture

Status: Active » Closed (duplicate)

It's working with the current 7.x-dev of Drupal core. So closing the bug report (keeping the status as duplicate).