Simplenews theming and snippets

Last updated on
12 September 2019

Newsletter theming

You can customize the theming of newsletters. Copy any of the *.tpl.php files from the simplenews module directory to your theme directory. Both general and by-newsletter theming can be performed.

Theme newsletter body

* simplenews-newsletter-body.tpl.php (for all newsletters)
* simplenews-newsletter-body--[tid].tpl.php (for newsletter series tid;
where [tid] is replaced by the term id of the newsletter taxonomy term.

* simplenews-newsletter-footer.tpl.php (for all newsletters)
* simplenews-newsletter-footer--[tid].tpl.php (for newsletter series tid)
The files are self documented listing all available variables.

Using the Display fields settings each field of a simplenews newsletter can be displayed or hidden in plain text and/or HTML newsletters. You find these settings at: admin/content/node-type/my-node-type/display

CSS in HTML newsletter

Although simplenews does not support HTML newsletters on its own, this tip is worth mentioning: Place your CSS inside the HTML <body> tag as described here.

Simplenews code snippets

A single subscription block for all newsletters

Create a custom block with this php code:

<?php
module_load_include('inc', 'simplenews', 'simplenews.subscription');
print drupal_get_form('simplenews_subscription_manager_form');
?>

Help improve this page

Page status: No known problems

You can: