Commit 20abfd24 authored by Bob Vincent's avatar Bob Vincent
Browse files

Remove dependency on Echo and MailMIME.

parent 2adffec7
Loading
Loading
Loading
Loading
+22 −16
Original line number Diff line number Diff line
@@ -5,9 +5,6 @@
  <li>
    <p><a href="http://drupal.org/project/echo">Echo</a></p>
  </li>
  <li>
    <p><a href="http://drupal.org/project/mailmime">Mail MIME</a></p>
  </li>
  <li>
    <p><a href="http://drupal.org/project/mailsystem">Mail System</a></p>
  </li>
@@ -20,10 +17,13 @@
    <p><a href="http://drupal.org/project/emogrifier">Emogrifier</a></p>
  </li>
  <li>
    <p><a href="http://drupal.org/project/pathologic">Pathologic</a></p>
    <p><a href="http://drupal.org/project/filter_transliteration">Filter transliteration</a></p>
  </li>
  <li>
    <p><a href="http://drupal.org/project/filter_transliteration">Filter transliteration</a></p>
    <p><a href="http://drupal.org/project/mailmime">Mail MIME</a></p>
  </li>
  <li>
    <p><a href="http://drupal.org/project/pathologic">Pathologic</a></p>
    <p><em>Also available as a <a href="http://drupal.org/node/1095278#comment-4219530">patch</a>.</em></p>
  </li>
</ul>
@@ -31,24 +31,30 @@
<p>Visit the <a href="http://drupal.org/project/mailsystem">Mail System</a> settings page at <u>admin/settings/mailsystem</u> to select which parts of Drupal will use <a href="http://drupal.org/project/htmlmail">HTML Mail</a> instead of the <a href="http://api.drupal.org/api/drupal/modules--system--system.mail.inc/class/DefaultMailSystem/7">default</a> <a href="http://api.drupal.org/api/drupal/includes--mail.inc/function/drupal_mail_system/7">mail system</a>.</p>
<p>Visit the <a href="http://drupal.org/project/htmlmail">HTML Mail</a> settings page at <u>admin/settings/htmlmail</u> to select a theme, pre-filter, and post-filter for your messages.</p>
<h2>Theming</h2>
<p>The email message text goes through four transformations before sending:</p>
<p>The email message text goes through three transformations before sending:</p>
<ol style="list-style-type: decimal;">
  <li>
    <p>The <em>Text format pre-filter</em> from the module settings page is applied. This should be the same text format that your website uses for contributed content such as comments or blog postings. For consistency and security, it should include the the <a href="http://api.drupal.org/api/drupal/modules--filter--filter.module/function/_filter_htmlcorrector/6">Correct faulty and chopped off HTML</a> from <a href="http://api.drupal.org/api/drupal/modules--filter--filter.module/6">filter.module</a>, or a better replacement such as <a href="http://drupal.org/project/htmlpurifier">HTML Purifier</a> or <a href="http://drupal.org/project/htmlawed">htmLawed</a>.</p>
    <h3>Template File</h3>
    <p>A template file is applied to your message header, subject, and body text. The default template is the included <code>htmlmail.tpl.php</code> file. You may copy this file to your default theme directory and use it to customize the contents and formatting of your messages. The comments within that file contain complete documentation on its usage.</p>
  </li>
  <li>
    <h3>Theming</h3>
    <p><em>(Optional: requires <a href="http://drupal.org/project/echo">Echo</a> module.)</em> The templated text may be wrapped in a website theme. This lets you use any one of <a href="http://drupal.org/project/themes">over 800</a> themes to style your messages. Creating an email-specific sub-theme lets you use the full power of the <a href="http://drupal.org/documentation/theme">drupal theme system</a> to format your messages.</p>
  </li>
  <li>
    <p>A theme template is applied. The default template is the included <code>htmlmail.tpl.php</code> file. You may copy this file to your theme directory and use it to customize the contents and formatting of your messages. The comments within the file contain complete documentation on its usage.</p>
    <h3>Post-filtering</h3>
    <p>You may choose a <cite>text format</cite> to be used for filtering email messages <em>after</em> theming. This allows you to use any combination of <a href="http://drupal.org/project/modules/?filters=type%3Aproject_project%20tid%3A63%20hash%3A1hbejm%20-bs_project_sandbox%3A1%20bs_project_has_releases%3A1">over 200 filter modules</a> to make final changes to your message before sending.</p>
    <p>Here is a recommended configuration:</p>
    <ul>
      <li>
        <p><a href="http://drupal.org/project/emogrifier">Emogrifier</a> Converts stylesheets to inline style rules for consistent display on mobile devices and webmail.</p>
      </li>
      <li>
    <p>The message may be wrapped in a website theme selected on the module settings page. Creating an email-specific sub-theme lets you use the full power of the <a href="http://drupal.org/documentation/theme">drupal theme system</a> to format your messages.</p>
        <p><a href="http://drupal.org/project/filter_transliteration">Transliteration</a> Converts non-ASCII text to US-ASCII equivalents. This helps prevent Microsoft "smart-quotes" from appearing as question-marks in Mozilla Thunderbird.</p>
      </li>
      <li>
    <p>The <em>Text format post-filter</em> from the module settings page is applied. For best results, this should be an email-specific input format containing the following text format filters:</p>
    <ul>
      <li><a href="http://drupal.org/project/filter_transliteration">Transliteration</a></li>
      <li><a href="http://drupal.org/project/emogrifier">Emogrifier</a></li>
      <li><a href="http://drupal.org/project/pathologic">Pathologic</a></li>
      <li><a href="http://api.drupal.org/api/drupal/modules--filter--filter.module/function/_filter_htmlcorrector/6">Correct faulty and chopped off HTML</a></li>
        <p><a href="http://drupal.org/project/pathologic">Pathologic</a> Converts relative URLS to absolute URLS so that clickable links in your message will work as intended.</p>
      </li>
    </ul>
  </li>
</ol>
+42 −35
Original line number Diff line number Diff line
@@ -7,8 +7,6 @@ messages the same way you theme the rest of your website.

*   [Echo](http://drupal.org/project/echo)

*   [Mail MIME](http://drupal.org/project/mailmime)

*   [Mail System](http://drupal.org/project/mailsystem)

## Installation
@@ -19,10 +17,12 @@ The following additional modules, while not required, are highly recommended:

*   [Emogrifier](http://drupal.org/project/emogrifier)

*   [Pathologic](http://drupal.org/project/pathologic)

*   [Filter transliteration](http://drupal.org/project/filter_transliteration)

*   [Mail MIME](http://drupal.org/project/mailmime)

*   [Pathologic](http://drupal.org/project/pathologic)

    *Also available as a [patch](http://drupal.org/node/1095278#comment-4219530).*

## Configuration
@@ -39,37 +39,44 @@ and post-filter for your messages.

## Theming

The email message text goes through four transformations before sending:

1.  The *Text format pre-filter* from the module settings page is applied.
    This should be the same text format that your website uses for contributed
    content such as comments or blog postings.  For consistency and security,
    it should include the the
    [Correct faulty and chopped off HTML](http://api.drupal.org/api/drupal/modules--filter--filter.module/function/_filter_htmlcorrector/6)
    from
    [filter.module](http://api.drupal.org/api/drupal/modules--filter--filter.module/6),
    or a better replacement such as
    [HTML Purifier](http://drupal.org/project/htmlpurifier) or
    [htmLawed](http://drupal.org/project/htmlawed).

2.  A theme template is applied. The default template is the included
    `htmlmail.tpl.php` file.  You may copy this file to your theme directory
    and use it to customize the contents and formatting of your messages.  The
    comments within the file contain complete documentation on its usage.

3.  The message may be wrapped in a website theme selected on the module settings
    page.  Creating an email-specific sub-theme lets you use the full power of
    the [drupal theme system](http://drupal.org/documentation/theme) to format
    your messages.

4.  The *Text format post-filter* from the module settings page is applied. For
    best results, this should be an email-specific input format containing the
    following text format filters:
The email message text goes through three transformations before sending:

1.  <h3>Template File</h3>
    A template file is applied to your message header, subject, and body text.
    The default template is the included `htmlmail.tpl.php` file.  You may copy
    this file to your default theme directory and use it to customize the
    contents and formatting of your messages.  The comments within that file
    contain complete documentation on its usage.

2.  <h3>Theming</h3>
    *(Optional: requires [Echo](http://drupal.org/project/echo) module.)*
    The templated text may be wrapped in a website theme.  This lets you
    use any one of [over 800](http://drupal.org/project/themes) themes to
    style your messages.  Creating an email-specific sub-theme lets you use
    the full power of the
    [drupal theme system](http://drupal.org/documentation/theme)
    to format your messages.

3.  <h3>Post-filtering</h3>
    You may choose a <cite>text format</cite> to be used for filtering email
    messages *after* theming. This allows you to use any combination of
    [over 200 filter modules](http://drupal.org/project/modules/?filters=type%3Aproject_project%20tid%3A63%20hash%3A1hbejm%20-bs_project_sandbox%3A1%20bs_project_has_releases%3A1)
    to make final changes to your message before sending.

    Here is a recommended configuration:

    * [Transliteration](http://drupal.org/project/filter_transliteration)
    *   [Emogrifier](http://drupal.org/project/emogrifier)
        Converts stylesheets to inline style rules for consistent display on
        mobile devices and webmail.

    *   [Transliteration](http://drupal.org/project/filter_transliteration)
        Converts non-ASCII text to US-ASCII equivalents.  This helps prevent
        Microsoft "smart-quotes" from appearing as question-marks in
        Mozilla Thunderbird.

    *   [Pathologic](http://drupal.org/project/pathologic)
    * [Correct faulty and chopped off HTML](http://api.drupal.org/api/drupal/modules--filter--filter.module/function/_filter_htmlcorrector/6)
        Converts relative URLS to absolute URLS so that clickable links in
        your message will work as intended.

## Troubleshooting

+51 −49
Original line number Diff line number Diff line
@@ -6,18 +6,18 @@ HTML Mail
Requirements

     * [2]Echo
     * [3]Mail MIME
     * [4]Mail System
     * [3]Mail System

Installation

   [5]Install as usual.
   [4]Install as usual.

   The following additional modules, while not required, are highly
   recommended:
     * [6]Emogrifier
     * [7]Pathologic
     * [8]Filter transliteration
     * [5]Emogrifier
     * [6]Filter transliteration
     * [7]Mail MIME
     * [8]Pathologic
       Also available as a [9]patch.

Configuration
@@ -31,34 +31,38 @@ Configuration

Theming

   The email message text goes through four transformations before
   The email message text goes through three transformations before
   sending:
    1. The Text format pre-filter from the module settings page is
       applied. This should be the same text format that your website uses
       for contributed content such as comments or blog postings. For
       consistency and security, it should include the the [15]Correct
       faulty and chopped off HTML from [16]filter.module, or a better
       replacement such as [17]HTML Purifier or [18]htmLawed.
    2. A theme template is applied. The default template is the included
       htmlmail.tpl.php file. You may copy this file to your theme
       directory and use it to customize the contents and formatting of
       your messages. The comments within the file contain complete
       documentation on its usage.
    3. The message may be wrapped in a website theme selected on the
       module settings page. Creating an email-specific sub-theme lets you
       use the full power of the [19]drupal theme system to format your
       messages.
    4. The Text format post-filter from the module settings page is
       applied. For best results, this should be an email-specific input
       format containing the following text format filters:
          + [20]Transliteration
          + [21]Emogrifier
          + [22]Pathologic
          + [23]Correct faulty and chopped off HTML
    1. Template File
       A template file is applied to your message header, subject, and
       body text. The default template is the included htmlmail.tpl.php
       file. You may copy this file to your default theme directory and
       use it to customize the contents and formatting of your messages.
       The comments within that file contain complete documentation on its
       usage.
    2. Theming
       (Optional: requires [15]Echo module.) The templated text may be
       wrapped in a website theme. This lets you use any one of [16]over
       800 themes to style your messages. Creating an email-specific
       sub-theme lets you use the full power of the [17]drupal theme
       system to format your messages.
    3. Post-filtering
       You may choose a text format to be used for filtering email
       messages after theming. This allows you to use any combination of
       [18]over 200 filter modules to make final changes to your message
       before sending.
       Here is a recommended configuration:
          + [19]Emogrifier Converts stylesheets to inline style rules for
            consistent display on mobile devices and webmail.
          + [20]Transliteration Converts non-ASCII text to US-ASCII
            equivalents. This helps prevent Microsoft "smart-quotes" from
            appearing as question-marks in Mozilla Thunderbird.
          + [21]Pathologic Converts relative URLS to absolute URLS so that
            clickable links in your message will work as intended.

Troubleshooting

   Visit the [24]issue queue for support and feature requests.
   Visit the [22]issue queue for support and feature requests.

Related Modules

@@ -105,37 +109,35 @@ Documentation

Original Author

     * [25]Chris Herberte
     * [23]Chris Herberte

Current Maintainer

     * [26]Bob Vincent
     * [24]Bob Vincent

References

   1. http://drupal.org/project/htmlmail
   2. http://drupal.org/project/echo
   3. http://drupal.org/project/mailmime
   4. http://drupal.org/project/mailsystem
   5. http://drupal.org/documentation/install/modules-themes/modules-5-6
   6. http://drupal.org/project/emogrifier
   7. http://drupal.org/project/pathologic
   8. http://drupal.org/project/filter_transliteration
   3. http://drupal.org/project/mailsystem
   4. http://drupal.org/documentation/install/modules-themes/modules-5-6
   5. http://drupal.org/project/emogrifier
   6. http://drupal.org/project/filter_transliteration
   7. http://drupal.org/project/mailmime
   8. http://drupal.org/project/pathologic
   9. http://drupal.org/node/1095278#comment-4219530
  10. http://drupal.org/project/mailsystem
  11. http://drupal.org/project/htmlmail
  12. http://api.drupal.org/api/drupal/modules--system--system.mail.inc/class/DefaultMailSystem/7
  13. http://api.drupal.org/api/drupal/includes--mail.inc/function/drupal_mail_system/7
  14. http://drupal.org/project/htmlmail
  15. http://api.drupal.org/api/drupal/modules--filter--filter.module/function/_filter_htmlcorrector/6
  16. http://api.drupal.org/api/drupal/modules--filter--filter.module/6
  17. http://drupal.org/project/htmlpurifier
  18. http://drupal.org/project/htmlawed
  19. http://drupal.org/documentation/theme
  15. http://drupal.org/project/echo
  16. http://drupal.org/project/themes
  17. http://drupal.org/documentation/theme
  18. http://drupal.org/project/modules/?filters=type%3Aproject_project%20tid%3A63%20hash%3A1hbejm%20-bs_project_sandbox%3A1%20bs_project_has_releases%3A1
  19. http://drupal.org/project/emogrifier
  20. http://drupal.org/project/filter_transliteration
  21. http://drupal.org/project/emogrifier
  22. http://drupal.org/project/pathologic
  23. http://api.drupal.org/api/drupal/modules--filter--filter.module/function/_filter_htmlcorrector/6
  24. http://drupal.org/project/issues/htmlmail
  25. http://drupal.org/user/1171
  26. http://drupal.org/user/36148
  21. http://drupal.org/project/pathologic
  22. http://drupal.org/project/issues/htmlmail
  23. http://drupal.org/user/1171
  24. http://drupal.org/user/36148
+68 −37
Original line number Diff line number Diff line
@@ -18,27 +18,24 @@ function htmlmail_admin_settings() {
    '#title' => '<h3>' . t('Step 1') . '</h3>',
    '#collapsible' => FALSE,
  );
  $form['Step 1']['htmlmail_prefilter'] = array(
    '#type' => 'select',
    '#title' => t('Text format pre-filter'),
    '#default_value' => variable_get('htmlmail_prefilter', ''),
    '#options' => $formats,
    '#description' => t('Choose a <a href="/admin/config/content/formats">text format</a> to be used for filtering email messages <em>before</em> the selected theme or template is applied.'),
  );
  $form['Step 2'] = array(
    '#type' => 'fieldset',
    '#title' => '<h3>' . t('Step 2') . '</h3>',
    '#collapsible' => FALSE,
  );
  $form['Step 2']['htmlmail_template'] = array(
  $form['Step 1']['htmlmail_template'] = array(
    '#type' => 'fieldset',
    '#title' => t('Template file'),
    '#prefix' => '<strong>' . t('Template file:') . '</strong><br />'
    . t(
      'A template file is applied to your message header, subject, and body '
      . 'text.  You may copy the <a href="!uri">!template</a> file to your '
      . 'default theme directory and use it to customize your messages.',
      array(
        '!uri' => url('http://drupalcode.org/project/htmlmail.git/blob/refs/heads/6.x-2.x:/htmlmail.tpl.php'),
        '!template' => '<code>htmlmail.tpl.php</code>'
      )
    ),
    '#title' => t('Instructions'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );
  $form['Step 2']['htmlmail_template']['instructions'] = array(
  $form['Step 1']['htmlmail_template']['instructions'] = array(
    '#type' => 'item',
    '#title' => 'Instructions',
    '#suffix' => t(
      // Begin instructions.
'<p>When formatting an email message, Drupal determines the active template directory by looking for <code>htmlmail.tpl.php</code> file in the following locations:</p>
@@ -112,47 +109,81 @@ function htmlmail_admin_settings() {
      // End instructions.
    ),
  );
  $form['Step 2']['htmlmail_debug'] = array(
  $form['Step 1']['htmlmail_debug'] = array(
    '#type' => 'checkbox',
    '#prefix' => '<br /><em>' . t('(Optional)') . '</em>',
    '#title' => t('Debug'),
    '#prefix' => '<br /><em>' . t('(Optional)') . '</em>',
    '#default_value' => variable_get('htmlmail_debug', '0'),
    '#description' => t('Add debugging info to email.'),
    '#description' => t('Add debugging info.'),
  );
  $form['Step 3'] = array(
  $form['Step 2'] = array(
    '#type' => 'fieldset',
    '#title' => '<h3>' . t('Step 3') . '</h3>',
    '#title' => '<h3>' . t('Step 2') . '</h3>',
    '#collapsible' => FALSE,
  );
  $form['Step 3']['htmlmail_theme'] = array(
  $form['Step 2']['htmlmail_theme'] = array(
    '#type' => 'select',
    '#title' => t('Theme to use for emails'),
    '#title' => t('Theming'),
    '#default_value' => variable_get('htmlmail_theme', ''),
    '#options' => htmlmail_get_allowed_themes(),
    '#description' => t(
      'You may use a template or a website theme to format your emails. '
      . 'See <a href="!url">!readme</a> for details.',
    '#disabled' => !module_exists('echo'),
    '#prefix' => module_exists('echo') ? '': '<em>' . t(
      'Disabled: requires the <a href="!echo">Echo</a> module.',
      array('!echo' => url('http://drupal.org/project/echo'))
    ) . '</em>',
    '#suffix' => t(
      'The templated text may be wrapped in a website theme.  This lets you '
      . 'use any one of <a href="%themes">over 800</a> themes to style your '
      . 'messages.  Creating an email-specific sub-theme lets you use the full '
      . 'power of the <a href="%theme_system">drupal theme system</a> to '
      . 'format your messages.',
      array(
        '!readme' => 'README.txt',
        '!url' => url(drupal_get_path('module', 'htmlmail') . '/README.txt'),
        '%themes' => 'http://drupal.org/project/themes',
        '%theme_system' => 'http://drupal.org/documentation/theme',
      )
    ),
  );
  $form['Step 4'] = array(
  $form['Step 3'] = array(
    '#type' => 'fieldset',
    '#title' => '<h3>' . t('Step 4') . '</h3>',
    '#title' => '<h3>' . t('Step 3') . '</h3>',
    '#collapsible' => FALSE,
  );
  $form['Step 4']['htmlmail_postfilter'] = array(
  $form['Step 3']['htmlmail_postfilter'] = array(
    '#type' => 'select',
    '#title' => t('Text format post-filter'),
    '#title' => t('Post-filtering'),
    '#default_value' => variable_get('htmlmail_postfilter', ''),
    '#options' => $formats,
    '#description' => t(
      'Choose a <a href="!url">text format</a> to be used for filtering email '
      . 'messages <em>after</em> the selected theme or template is applied.',
      array('!url' => url('/admin/config/content/formats'))
    ),
    '#suffix' => '<p>' . t(
      'You may choose a <a href="!formats">text format</a> to be used for '
      . 'filtering email messages <em>after</em> theming.  This allows you to '
      . 'use any combination of <a href="!filters">over 200 filter modules</a> '
      . 'to make final changes to your message before sending.',
      array(
        '!formats' => url('/admin/config/content/formats'),
        '!filters' => url('http://drupal.org/project/modules/?filters=type%3Aproject_project%20tid%3A63%20hash%3A1hbejm%20-bs_project_sandbox%3A1%20bs_project_has_releases%3A1'),
      )
    ) . '</p><p>' . t(
      'Here is a recommended configuration:'
    ) . '</p><ul><li><dl><dt>' . t(
      '<a href="!emogrifier">Emogrifier</a>',
      array('!emogrifier' => url('http://drupal.org/project/emogrifier'))
    ) . '</dt><dd>' . t(
      'Converts stylesheets to inline style rules for consistent display on '
      . 'mobile devices and webmail.'
    ) . '</dd></dl></li><li><dl><dt>' . t(
      '<a href="!transliteration">Transliteration</a>',
      array('!transliteration' => url('http;//drupal.org/project/filter_transliteration'))
    ) . '</dt><dd>' . t(
      'Converts non-ASCII text to US-ASCII equivalents. This helps prevent '
      . 'Microsoft <q>smart-quotes</q> from appearing as question-marks in '
      . 'Mozilla Thunderbird.'
    ) . '</dd></dl></li><li><dl><dt>' . t(
      '<a href="!pathologic">Pathologic</a>',
      array('!pathologic' => url('http://drupal.org/project/pathologic'))
    ) . '</dt><dd>' . t(
      'Converts relative URLS to absolute URLS so that clickable links in your '
      . 'message will work as intended.'
    ) . '</dd></dl></ul>'
  );
  return system_settings_form($form);
}
+0 −2
Original line number Diff line number Diff line
package = Mail
name = HTML Mail
description = "Enables HTML in system emails."
dependencies[] = echo
dependencies[] = mailmime
dependencies[] = mailsystem
php = 5.0
core = 6.x
Loading