diff --git a/README.txt b/README.txt index 3009992..aff9119 100644 --- a/README.txt +++ b/README.txt @@ -3,7 +3,7 @@ DESCRIPTION ----------- Simplenews publishes and sends newsletters to lists of subscribers. Both -anonymous and authenticated users can opt-in to different mailing lists. +anonymous and authenticated users can opt-in to different mailing lists. HTML email can be sent by adding Mime mail module. @@ -35,7 +35,7 @@ INSTALLATION 3. ACCESS PERMISSION Grant the access at the Access control page: - People > Permissions. + People > Permissions. 4. CONFIGURE SIMPLENEWS @@ -46,8 +46,8 @@ INSTALLATION Structure > edit content type > Publishing options Add and configure newsletter categories: - Structure > Newsletters > Add newsletter category - Structure > Newsletters > edit newsletter category + Structure > Web Services > Newsletters > Add newsletter category + Structure > Web Services > Newsletters > edit newsletter category 5. ENABLE SIMPLENEWS BLOCK @@ -59,16 +59,16 @@ INSTALLATION 6. CONFIGURE SIMPLENEWS BLOCK Configure the Simplenews block on the Block configuration page. You reach - this page from Block admin page (Structure > Blocks). + this page from Block admin page (Structure > Blocks). Click the 'Configure' link of the appropriate simplenews block. - + Permission "subscribe to newsletters" is required to view the subscription form in the simplenews block or to view the link to the subscription form. 7. SIMPLENEWS BLOCK THEMING - More control over the content of simplenews blocks can be achieved using - the block theming. Theme your simplenews block by copying + More control over the content of simplenews blocks can be achieved using + the block theming. Theme your simplenews block by copying simplenews-block.tpl.php into your theme directory and edit the content. The file is self documented listing all available variables. @@ -77,7 +77,7 @@ INSTALLATION simplenews-block.tpl--[tid].php (for newsletter series tid) 8. MULTILINGUAL SUPPORT - + Simplenews supports multilingual newsletters for node translation, multilingual taxonomy and url path prefixes. @@ -95,7 +95,7 @@ INSTALLATION Use 'per language terms' for mailing lists each with a different language. Newsletters of different language each have their own tag and own list of subscribers. - + Path prefixes are added to footer message according to the subscribers preferred language. @@ -117,37 +117,43 @@ INSTALLATION general and by-newsletter theming can be performed. Theme newsletter body: simplenews-newsletter-body.tpl.php (for all newsletters) - simplenews-newsletter-body--[category machine name].tpl.php + simplenews-newsletter-body--[tid].tpl.php simplenews-newsletter-body--[view mode].tpl.php - simplenews-newsletter-body--[category machine name]--[view mode].tpl.php + simplenews-newsletter-body--[tid]--[view mode].tpl.php - [category machine name]: Machine readable name of the newsletter category - [view mode]: 'email_plain', 'email_html', 'email_textalt' + [tid]: Machine readable name of the newsletter category + [view mode]: 'email-plain', 'email-html', 'email-textalt' Example: - simplenews-newsletter-body--drupal--email_plain.tpl.php + simplenews-newsletter-body--1--email-plain.tpl.php Theme newsletter footer: simplenews-newsletter-footer.tpl.php (for all newsletters) - simplenews-newsletter-footer--[category machine name].tpl.php + simplenews-newsletter-footer--[tid].tpl.php simplenews-newsletter-footer--[view mode].tpl.php - simplenews-newsletter-footer--[category machine name]--[view mode].tpl.php + simplenews-newsletter-footer--[tid]--[view mode].tpl.php - [category machine name]: Machine readable name of the newsletter category - [view mode]: 'email_plain', 'email_html', 'email_textalt' + [tid]: Machine readable name of the newsletter category + [view mode]: 'email-plain', 'email-html', 'email-textalt' Example: - simplenews-newsletter-footer--drupal--email_plain.tpl.php + simplenews-newsletter-footer--1--email-plain.tpl.php The template files are self documented listing all available variables. + Depending on how the mails are sent (e.g. how cron is triggered), either the + default or the admin theme might be used, if one has been configured. + To prevent this, Simplenews supports the mail theme setting from the + mailsystem module (http://drupal.org/project/mailsystem). Install it, choose + the mail theme and the newsletter templates from that theme will be used no + matter which other themes are enabled. Using the fields Display settings each field of a simplenews newsletter can be displayed or hidden in 'plain text', 'HTML' and 'HTML text alternative' - format. You find these settings at: - Structure > Content types > Manage display > Email + format. You find these settings at: + Structure > Content types > Manage display + Enable the view modes you want to configure and configure their display. 10. SEND MAILING LISTS - Cron is required to send large mailing lists. Cron jobs can be triggered - by Poormanscron or any other cron mechanism such as crontab. + Cron is required to send large mailing lists. If you have a medium or large size mailing list (i.e. more than 500 subscribers) always use cron to send the newsletters. @@ -165,7 +171,7 @@ INSTALLATION These settings are found on the Newsletter Settings page under 'Send mail' options at: - Administer > Site configuration > Simplenews > Send mail. + Administer > Configuration > Web Services > Newsletters > Settings > Send mail. 11. (UN)SUBSCRIBE CONFIRMATION @@ -173,13 +179,13 @@ INSTALLATION Upon confirmation the user is directed to the home page, where a message will be displayed. On the Simplenews subscription admin page you can specify an alternative destination page. - Structure > Newsletters > edit newsletter category > Subscription settings + Structure > Configuration > Web Services > Newsletters > edit newsletter category > Subscription settings To skip the confirmation page you can add parameters to the subscription URL. Example: [simplenews-subscribe-url]/ok When an alternative destination page has been defined the extra parameters will be added to the destination URL. - Example: [simplenews-subscribe-url]/ok + Example: [simplenews-subscriber:subscribe-url]/ok Destination: node/123 Destination URL: node/123/ok @@ -221,6 +227,21 @@ INSTALLATION to $base_url = 'http://www.example.com'; // NO trailing slash! + +RELATED MODULES +------------ + + * Elysia Cron + Allows fine grained control over cron tasks. + http://http://drupal.org/project/elysia_cron + * Mailsystem + Extends drupal core mailystem wirh Administrative UI and Developers API. + http://drupal.org/project/mailsystem + * Maillog + Captures outgoing mails, helps users debugging simplenews. + http://drupal.org/project/maillog + + DOCUMENTATION ------------- More help can be found on the help pages: example.com/admin/help/simplenews diff --git a/simplenews.module b/simplenews.module index bdd96c0..7182cbd 100644 --- a/simplenews.module +++ b/simplenews.module @@ -2360,6 +2360,7 @@ function simplenews_theme() { 'language' => NULL, ), 'path' => $path . '/theme', + 'mail theme' => TRUE, 'template' => 'simplenews-newsletter-body', 'pattern' => 'simplenews-newsletter-body__', ), @@ -2372,6 +2373,7 @@ function simplenews_theme() { 'language' => NULL, ), 'path' => $path . '/theme', + 'mail theme' => TRUE, 'template' => 'simplenews-newsletter-footer', 'pattern' => 'simplenews-newsletter-footer__', ), @@ -2541,6 +2543,9 @@ function template_preprocess_simplenews_newsletter_body(&$variables) { unset($variables['build']['links']); unset($variables['build']['comments']); + $theme = function_exists('mailsystem_get_mail_theme') ? mailsystem_get_mail_theme() : path_to_theme(); + $variables['simplenews_theme'] = drupal_get_path('theme', $theme); + $variables['title'] = check_plain($variables['build']['#node']->title); $variables['language'] = $variables['build']["#language"]; $variables['view_mode'] = $variables['build']['#view_mode']; @@ -2565,6 +2570,9 @@ function template_preprocess_simplenews_newsletter_footer(&$variables) { unset($variables['build']['links']); unset($variables['build']['comments']); + $theme = function_exists('mailsystem_get_mail_theme') ? mailsystem_get_mail_theme() : path_to_theme(); + $variables['simplenews_theme'] = drupal_get_path('theme', $theme); + $variables['unsubscribe_text'] = t('Unsubscribe from this newsletter', array(), array('langcode' => $variables['language'])); $variables['test_message'] = t('This is a test version of the newsletter.', array(), array('langcode' => $variables['language'])); diff --git a/theme/simplenews-newsletter-body.tpl.php b/theme/simplenews-newsletter-body.tpl.php index 696fc52..5152662 100644 --- a/theme/simplenews-newsletter-body.tpl.php +++ b/theme/simplenews-newsletter-body.tpl.php @@ -15,8 +15,7 @@ * - $build: Array as expected by render() * - $build['#node']: The $node object * - $title: Node title - * - $language: Language code - * - $view_mode: Active view mode + * - $simplenews_theme: Contains the path to the configured simplenews theme. * * @see template_preprocess_simplenews_newsletter_body() */ diff --git a/theme/simplenews-newsletter-footer.tpl.php b/theme/simplenews-newsletter-footer.tpl.php index 464de5d..485646a 100644 --- a/theme/simplenews-newsletter-footer.tpl.php +++ b/theme/simplenews-newsletter-footer.tpl.php @@ -17,6 +17,7 @@ * - $format: newsletter format [plain|html] * - $unsubscribe_text: unsubscribe text * - $test_message: test message warning message + * - $simplenews_theme: path to the configured simplenews theme * * Available tokens: * - [simplenews-subscriber:unsubscribe-url]: unsubscribe url to be used as link