I am having a themed newsletter using mytheme_simplenews_template_mail().

The template works fine using the following sending methods:

  • Send one test newsletter to the test address
  • Running cron manually

Odd enough, it is overwritten in an ugly way when running cron automatically: a style attribute is added to every single tag destroying the visual aspect of the template.

I can't find while this is happening. I am only guessing that it could be related to permissions but what confuse me the most is that the function is called, the template I provide is used… but in an scrambled way!

Comments

tomgf’s picture

This seems to be in relation with mimemail_compress.

Could it be the case of this module acting different on authenticated vs. anonymous users?

tomgf’s picture

Status: Active » Fixed

I found where this problem lies: it's not a Simplenews issue but a Mimemail one… Documented here (#958146):

If you use sub-themes or multiple themes, especially if you use a different administration theme than your default theme, you might end up with a different theme to what you expect. This is a well-known bug which is hard to fix and not just Mime Mail is affected by it but Simplenews too. See #374222: Template files do not work when using admin theme for more information.

I am using two themes: one for administration and another for the public. Either Send one test newsletter to the test address or manually run cron are using the admin theme. Regular cron is using the public theme and it wasn't finding there the proper mimemail-message.tpl.php template. Therefore, it was using the default one that creates a clash with Simplenews Template.

Solution

If you are using a different admin theme, remember to check – and duplicate – functions and templates in both places.

Status: Fixed » Closed (fixed)

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