Simplenews Template is a Drupal module that extends the Simplenews module by providing a themable template with configurable header, footer and style. Template, header, footer and style are configurable for each newsletter independently.

Simplenews Template can be used in conjunction with RelatedContent.

Requirements

Installation

Install Simplenews Template as follows:

  1. Download, install and configure the Mime Mail module.
  2. Download, install and configure the Simplenews module.
  3. Download the latest stable version of Simplenews Template.
  4. Unpack the downloaded file into sites/all/modules or the modules directory of your site.
  5. Go to Administer » Site building » Modules and enable the module.
  6. OPTIONAL: To enable automatic insertion of the Simplenews Template style definitions into HTML-tags of e-mails, download Emogrifier and extract the file emogrifier.php file into the Simplenews Template folder. More information below.

Configuration

There is no configuration for the Simplenews Template module itself.

Usage

Header, footer and style is setup for each newsletter individually as follows:

  • If not already existing, go to admin/content/newsletters/types (admin/content/simplenews/types in D6) and add at least one newsletter.
  • Go to admin/content/newsletters/settings, and select the newsletter to be configured.
  • Open the collapsible section Header.
    • Check the box Include header in nodes? to include the header when viewing nodes with issues of the newsletter. The header is always included in e-mails with issues of the newsletter.
    • Fill out the text area Header with the content to be shown at the beginning of each issue of the newsletter. Leave blank to not include a header. Do not forget to choose an appropriate input format.
  • Open the collapsible section called Footer.
    • Check the box Include footer in nodes? to include the footer when viewing nodes with issues of the newsletter. The footer is always included in e-mails with issues of the newsletter.
    • Fill out the text area Footer with the content to be shown at the end of each issue of the newsletter. Leave blank to not include a footer. Do not forget to choose an appropriate input format.
  • Open the collapsible section called Style.
    • Check the box Include CSS in nodes? to include the CSS rules when viewing nodes with issues of the newsletter. The CSS rules are always included in e-mails with issues of the newsletter.
    • Fill out the text area called CSS with CSS rules, e.g. div.message { color: red }.
    • ill out the text field called Body background color with the HTML color value, e.g. Yellow or #ffff00, to use in the bgcolor attribute of the <body>-element.

Theming

The included simplenews_template.tpl.php file is the default template for the HTML e-mails. DON'T EDIT IT!

If you want to make changes to simplenews_template.tpl.php, copy it to the current theme's directory, and make your modification to that file. See simplenews_template.tpl.php for more information.

If you want a particular newsletter to have an own template, copy simplenews_template.tpl.php to simplenews_template-xxx.tpl.php, where xxx is the identity number of the newsletter, and move it to the current theme's directory. You find the newsletters identity number at the end of the URL to its settings page, e.g. the page with the header, footer and style fields.

In the 6.x beta branch theming is done by overriding theme_simplenews_template_content and theme_simplenews_template_mail (see simplenews_template.module for examples)

Emogrifier

Some e-mail clients, notably Microsoft Outlook 2007 and Google Gmail, discharge CSS defintions within <style> tags. The solution is to put the style definitions into the e-mail HTML-tags. Simplenews Template can do this "automagically" if Emogrifier installed as described above.

Emogrifier supports not all CSS2 selectors, e.g. pseudo selectors. All CSS1 selectors work.

Emogrifier parses the CSS selectors in order. Later selectors will therefore override earlier selectors that apply to the same element.

Notice that even with Emogrifier certain e-mail clients will ignore certain CSS properties. For more information, see http://www.email-standards.org/.

Comments

Balbo’s picture

And what about version for Drupal6? I can't find any simplenews_template.tpl.php

victor.stan@gmail.com’s picture

I am currently wondering the same thing, but here he says:

In the 6.x beta branch theming is done by overriding theme_simplenews_template_content and theme_simplenews_template_mail (see simplenews_template.module for examples)

So I'm looking at that file and its pretty self explanatory, but I wonder if modifying this file is the best thing possible, since i can image any changes will be overwritten if there are updates to the module...

Anyone have any suggestions/ideas?

MustangGB’s picture

Have you tried OVERRIDING as the information states
This won't involve editing any module files

Arjean-1’s picture

Just for reference:
Drupal 6 tutorial over here: http://drupal.org/node/369757

victor.stan@gmail.com’s picture

Edit: this question wasn't relevant to this topic...