In order to create a fully customized newsletter, simplenews_newsletter_body template needs access to the $context['node']. I have a newsletter which uses CCK node_reference fields to point to other nodes on the website. By having $node, I can load the other node's teasers into the email template and send out a fully customized newsletter.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | simplenews.335537.patch | 19.15 KB | sutharsan |
| simplenews_insert_node_to_template_body.patch | 1.6 KB | John Hwang |
Comments
Comment #1
sutharsan commentedI like the idea but want to take it a step further. I want the newsletter body (and footer) to be more easy themable using .tpl.php files. But this should not have a big impact on performance. For this reason the body and footer must be themed and buffered. But since the footer contains recipient specific data (the unscubscription link) is requires a different approach using tokens in the footer.
The attached patch is the result. Patch is committed.
Note that a few existing tokens have changed:
!newsletter is now: !newsletter_name
!confirmation_url is now: !confirm_subscribe_url or !confirm_unsubscribe_url
If you have customized the (un)subscription confirmation emails you may need to modify tokens in it.
Comment #2
sutharsan commentedIssue fixed with above patch: #315494: !date, !site, etc don't get replaced on node view