Hi,
I am using HTML Mail (7.x-2.61) with Simplenews (7.x) and the Mail System Module for sending html newsletters.
My problem is that I do not know how to assign different templates for the different email types of the the same module. The same template is used for the actual newsletter as well as for the subscription confirmation emails.
I configured the mail system to use the HtmlMailSystem for the simplenews module and placed the appropriate template file (html--simplenews.tpl.php) in my email theme folder. But this template should only be used for the emails containing the newsletter and not for the confirmation emails as well.
If this is not the right place for asking such questions please give me a hint where I could answers get instead.
Many thanks,
Heiko
Comments
Comment #1
pillarsdotnet CreditAttribution: pillarsdotnet commentedNo, this is the right forum.
Newsletter template names work as follows:
htmlmail--simplenews--node.tpl.php
Newsletters delivered by email.
htmlmail--simplenews--subscribe.tpl.php
New subscriber confirmation messages.
htmlmail--simplenews--test.tpl.php
Newsletter test messages.
htmlmail--simplenews--unsubscribe.tpl.php
Unsubscribe confirmation messages.
htmlmail--simplenews.tpl.php
Default template for all simplenews messages, used when any of the above are missing.
Another approach would be to test the value of the
$key
variable within yourhtmlmail--simplenews.tpl.php
template. However, mixing presentation logic with business logic in this way is generally discouraged.If you selected a theme in your HTML Mail setup page, be sure to copy all templates (both originals and your overrides) to the corresponding theme directory.
If you selected "No theme" on the HTML Mail setup page, then put your template overrides in the HTML Mail module directory.
Comment #2
pillarsdotnet CreditAttribution: pillarsdotnet commentedI need to copy the above information to a documentation page for future reference.
Comment #3
einzelkind CreditAttribution: einzelkind commented@pillarsdotnet: Thank you very much!
That is what I was looking for.
cheers Heiko
Comment #4
einzelkind CreditAttribution: einzelkind commentedComment #5
pillarsdotnet CreditAttribution: pillarsdotnet commentedComment #6
einzelkind CreditAttribution: einzelkind commentedAnother thing concerning this issue which took me couple of hours to comprehend: The html newsletter template htmlmail--simplenews--node.tpl.php is not used when sending test newsletters. For this purpose you have to copy your template and name it htmlmail--simplenews--test.tpl.php.
In my opinion htmlmail--simplenews--node.tpl.php should be used for test newsletters as well if there is no htmlmail--simplenews--test.tpl.php template provided.
Comment #7
sgurlt CreditAttribution: sgurlt commentedSry for reopening this after such a long time, but I actually run into problems having 2 different newsletter groups with 2 different layouts.
Is there a solution for this aswell?
Maybe something like
htmlmail--simplenews--node--{id1}.tpl.php
htmlmail--simplenews--node--{id2}.tpl.php
Comment #7.0
sgurlt CreditAttribution: sgurlt commentedadded module version
Comment #8
salvis