Newsletter is a full Drupal 7 project now and can be found here.

http://drupal.org/sandbox/rootatwc/1212302

This module is in the final stages of development, fixing bugs and finalizing some thoughts.I developed it for a project of mine and decided to give it to the community..

I know there are a bunch of modules for newsletter, but most of them are for drupal 6 and abandoned
Also simplenews, has entirely different structure and would need a major rewrite to accomplish what i wanted.

So i decided to write this:)

  • Multiple newsletters lists configurable on terms, not vocabularies
  • Plain text or HTML out of the box
  • Multiple schedules Each newsletter can have more than one schedule, e.g. Daily, Monthly, Weekly, manually or even custom, eg after 10 new posts for this term...
  • Centralized administration Configuration and administration is not in 5 different spots
  • Users are able to customize the terms in the list they subscribe to..(aka exposed newsletters)
  • Custom template per list
  • Statistics
  • Integrates with colorbox,wysiwyg and jqplot
  • Newsletters can be sent that are irrelevant with site's content (eg a merry X-mas newsletter to all subscribers)
  • Drupal 7 only

Comments

shadcn’s picture

Installed, tested and I like the module. Easy and clean workflow.

Review :

  1. Licensing: No issues.
  2. Module duplication: Possible duplication of effort with simplenews. I see that simplenews can do most the the listed things with addon modules but they have not been ported yet. Paris, can you please compare and log what is different here. See these modules :
    • sequenced_newsletter
    • simplenews_scheduler
    • simplenews_analytics
    • simplenews_statistics
    • simplenews_template
  3. Code Review:
    • Break a line between functions declarations. eg.
      /**
       * Implements hook_taxonomy_term_delete().
       */
      function newsletter_taxonomy_term_delete($term) {
        db_delete('newsletter_index')
          ->condition('tid', $term->tid)
          ->execute();
      }
      /**
       * Implements hook_cron().
       */
      function newsletter_cron() {
        $status = array();
        $cron_lists = db_query('SELECT id, send_rate FROM {newsletter_lists} WHERE send_again = CURDATE() AND (send_rate = \'Daily\' OR send_rate = \'Weekly\' OR send_rate = \'Monthly\')')->fetchAll();
        if (is_array($cron_lists)) {
          foreach ($cron_lists as $cron_list) {
            $newsletter=new NewsletterMail($cron_list->id);
            $status[] = $newsletter->send();
            //@TODO update the last_sent and statistics
          }
        }
        NewsletterFunctions::feedback($status);
      }
      

      should be

      /**
       * Implements hook_taxonomy_term_delete().
       */
      function newsletter_taxonomy_term_delete($term) {
        db_delete('newsletter_index')
          ->condition('tid', $term->tid)
          ->execute();
      }
      
      /**
       * Implements hook_cron().
       */
      function newsletter_cron() {
        $status = array();
        $cron_lists = db_query('SELECT id, send_rate FROM {newsletter_lists} WHERE send_again = CURDATE() AND (send_rate = \'Daily\' OR send_rate = \'Weekly\' OR send_rate = \'Monthly\')')->fetchAll();
        if (is_array($cron_lists)) {
          foreach ($cron_lists as $cron_list) {
            $newsletter=new NewsletterMail($cron_list->id);
            $status[] = $newsletter->send();
            //@TODO update the last_sent and statistics
          }
        }
        NewsletterFunctions::feedback($status);
      }
      
    • Move hook_install and hook_unistall to a .install file.
    • Comment functions like these :
      function newsletter_lid_load($lid) {
        return db_query("SELECT * FROM {newsletter_lists} WHERE id = :id", array(':id' => $lid))->fetchObject();
      }
      function newsletter_sid_load($sid) {
        return db_query("SELECT * FROM {newsletter_subscribers} WHERE id = :id", array(':id' => $sid))->fetchObject();
      }
      function newsletter_tid_load($tid) {
        return db_query("SELECT * FROM {newsletter_templates} WHERE id = :id", array(':id' => $tid))->fetchObject();
      }
      
    • It might be better to place newsletter under "Structure" rather than first class citizens of the admin menu.
  4. Some errors encountered when sending newsletter :
        Notice: Array to string conversion in drupal_attributes() (line 2261 of /Applications/XAMPP/xamppfiles/htdocs/lab7.2/includes/common.inc).
        Notice: Array to string conversion in drupal_attributes() (line 2261 of /Applications/XAMPP/xamppfiles/htdocs/lab7.2/includes/common.inc).
        Notice: Undefined variable: items in NewsletterMail->send() (line 226 of /Applications/XAMPP/xamppfiles/htdocs/lab7.2/sites/all/modules/newsletter/includes/mail.inc.php).
        Warning: implode() [function.implode]: Invalid arguments passed in NewsletterMail->send() (line 226 of /Applications/XAMPP/xamppfiles/htdocs/lab7.2/sites/all/modules/newsletter/includes/mail.inc.php).
        Notice: Undefined variable: items in NewsletterMail->send() (line 226 of /Applications/XAMPP/xamppfiles/htdocs/lab7.2/sites/all/modules/newsletter/includes/mail.inc.php).
        Warning: implode() [function.implode]: Invalid arguments passed in NewsletterMail->send() (line 226 of /Applications/XAMPP/xamppfiles/htdocs/lab7.2/sites/all/modules/newsletter/includes/mail.inc.php).
    
shadcn’s picture

Status: Needs review » Needs work
ParisLiakos’s picture

Priority: Critical » Normal

damn..
Sorry i should mention to check 7.x branch and not the master one...i forgot to update the master one:/
anyways, i deleted master

The code changes you mentioned are already applied to 7.x branch.
Sorry again.

About the duplication:
I originally started working on simplenews but i figured that:

  1. many submodules, eg the template one are for the 1.x version of it, which is pretty old and abandoned
  2. no submodule that allows subscribers to choose the terms they subscribe to (exposed newsletter templates)
  3. the newsletter is configured based on taxonomy terms from all existing vocabularies and not a specific vocabulary like simplenews does
  4. you have the ability to send newsletters irrelevant with site's content
  5. the structure was very bad and confusing for not technical users and would need a major rewrite
  6. simplenews development is rather slow..i asked for co-maintainer status so i could speed things up (by doing some radical changes) but from the answer it was pretty clear that would be a slow proccess (no blames here,it is understandable and makes sense)..but i was in a hurry

so i decided to start my own module and now that basic functionality is there to apply for full project status, knowing that i would have issues with duplication:)

**about moving it to structure.. i agree,its just the client that want its there -.- .. so, if i get the full project status i will move it to structure, i promise..

ParisLiakos’s picture

Issue summary: View changes

added note about 7.x branch

ParisLiakos’s picture

Issue summary: View changes

removed the branch proposal since i deleted master and now there is only 7.x-1.x

ParisLiakos’s picture

Issue summary: View changes

update description

ParisLiakos’s picture

Issue summary: View changes

made integrations linkable

ParisLiakos’s picture

Priority: Normal » Major
Status: Needs work » Needs review

2 weeks since last review, bumping to major

ParisLiakos’s picture

Priority: Major » Critical

Some updates:

This module integrates now with

  • wysiwyg drupal module,for more user-friendly newsletter template edits
  • jquery charting library : jqplot for statistics graph (completely flash-free)
  • colorbox module, for subscription forms

Fixing bugs now so i can release a stable version (its already is on production, but not many subscribers yet)

ParisLiakos’s picture

Title: Newsletter » Newsletter (D7)
Priority: Normal » Critical

Updated title so its clear for which version this module is about, trying to help reviewers^^

shadcn’s picture

Hey Paris, sorry for the late reply. Been super busy. I'll make sure I review this today. and update. Thanks for your help and understanding :)

ParisLiakos’s picture

No problem Arshad.
Take your time, since it got bigger since the last time you checked it:P

ParisLiakos’s picture

StatusFileSize
new390.81 KB

I released alpha1 version, which i attach
also a demo site,using that version
http://rootatwc.com/d7/

derjochenmeyer’s picture

The alpha version in combination with the Demosite really really helped. Without this, I would have never tested this module.

ParisLiakos’s picture

thanks again for your time Jochen!

i hope i get the full project permissions sometime in the near future!

derjochenmeyer’s picture

A link on your sandbox to this issue would also help.

"If you like this newsletter module please help to make this a full project by reviewing this module and posting your feedback here: Newsletter (D7) - Drupal.org Project applications"

My first impression after reviewing this a bit:

  • This module is a promising approach to bring an easy out-of-the-box newsletter tool to Drupal.
  • It provieds a straight forward setup without the complexity of simplenews. After all I found this module looking for an alternative for simplenews.
ParisLiakos’s picture

You are right! i added it.

and yes one of the main reasons i started this was to bring something more end user friendy.well even for more technical ones, simplenews workflow aint easy

derjochenmeyer’s picture

Sorry I used the wrong link in my suggestion. Now the sandbox page links itself :) it should link here:
http://drupal.org/node/1225708

ParisLiakos’s picture

doh i didnt even test it:P just copied-pasted

ParisLiakos’s picture

check here for fresh tar.gz s of this module.
#1275554: Latest tar.gz archives for newsletter
I update it after each serious commit

itserich’s picture

Don't know if this is a way to help get it approved, but I have tried all sorts of newsletter, mail, subscription modules over the past year and Newsletter works right the first time and is intuitive. I think a module like this is necessary for community sites where people want to receive updates without being required to register.

Whoever has the power to assign something as a full project, please do it and help other people find it more easily. Thanks and thanks rootatwc!

Yuri’s picture

Category: task » support
Priority: Critical » Normal

As far as I've tested, it is indeed a very user friendly and all-in-one newsletter solution.
However, I got stuck on the mail template (in my case admin/newsletters/templates/edit/4?destination=admin/newsletters/templates) and the replacement patterns.

In the default template it shows
[repeat]
[item_title] -[item_date]
[item_teaser]
[/repeat]

and the explanation says:
[repeat] --- The section starting with this token will be replaced for all nodes that are to be sent with this list
[/repeat] --- End of the repeat section

But I don't understand how to make node(teasers) appear in the sent newsletter.
The email is successfully sent and received but the replacement patterns mentioned above are not replaced with the teasers.
So actually i have two questions: 1) how do i select nodes to be included in a newsletter and 2) Why don't the replacement patterns work.

The replacement pattern problem might have to do with the following:
After enabling your Newsletter module, and I create a new node (i.e. a blog post) I get an error:
Warning: Illegal offset type in isset or empty in pathauto_cleanstring() (line 180 of /home/primo1/public_html/sites/all/modules/pathauto/pathauto.inc).
Notice: Array to string conversion in pathauto_cleanstring() (line 185 of /home/primo1/public_html/sites/all/modules/pathauto/pathauto.inc).
Warning: Illegal offset type in pathauto_cleanstring() (line 223 of /home/primo1/public_html/sites/all/modules/pathauto/pathauto.inc).

(this set of error lines repeat 15 times on the same page)

As far as I see this error is similar to http://drupal.org/node/1246074 and indicates that the module is duplicating Tokens.
I have Token version 7.x-1.0-beta4 installed on my test site.

ParisLiakos’s picture

Category: support » task
Priority: Normal » Critical

Please dont hijack this thread.
for support requests open a new issue here

But the pathauto error is not related to newsletter since newsletter doesnt use token API (yet).
Finally to have nodes in the template you need to set taxonomy terms associated with the template.Then newsletter will automatically fetch the last nodes posted for these terms everytime its queued for cron

derjochenmeyer’s picture

Status: Needs review » Reviewed & tested by the community
  • Licensing: No problems found. Newsletter does not include any third party code. However it integrates with jqPlot which is dual licensed under the MIT and GPL version 2 licenses.
  • Module duplication: There is a groups.drupal.org page with a Comparison of Newsletter / External E-Mail Campaign Integration Modules. There is need for consolidation in many areas of Drupal development. However, the main competitor simplenews is not "simple" and development is rather slow. IMO there is room and serious need for competition to see some more innovation to happen here.
  • Overall understanding of Drupal API's: Drupal API's (hooks, new database abstraction layer, etc.) are used correctly. Maintainer plans to add and further improve views integration, use entities, etc.
  • Security: No obvious security issues found. Coder module returns no problems.
  • Drupal coding standards: The code looks very well structured – a lot better than many Drupal contrib modules (full projects). Coder module returns no coding style problems.
  • Code documentation: The code is documented well using doxygen style. However comments could be slightly improved ;) , e.g.:

    All documentation and comments should form proper sentences and use proper grammar and punctuation.

    See: Doxygen and comment formatting conventions

The maintainer of this sandbox project is very responsive, and solved all issues fast and friendly :) examples:
#1281444: Fix coder errors related to confirm_form()
#1275610: Notice: Undefined index: email in newsletter_subscribe_advanced() (line 95 of .../newsletter/includes/user.inc).
#1272130: Configuration changes made under admin/newsletters/configure (General Settings) cant be saved

There was ONLY positive feedback to this project (see #1, #17, #18, #20).

IMO this sandbox is ready to be released as a full project.

shadcn’s picture

Unfortunately, I did not have time to review the module after #1, but +1 from me for promoting this to a full project.

ParisLiakos’s picture

Thank you all!
@derjochenmeyer Once more, i appreciate it!Thank you for all your suggestions and the issues you opened,helping this module!I promise to work on documentation

tim.plunkett’s picture

Status: Reviewed & tested by the community » Needs work

This module is really very close. Only a couple issues remaining:

Using the path "admin/newsletter/*" doesn't follow the Information architecture standards laid out by core. It should likely be "admin/config/newsletter/*".

The includes should be renamed, admin.inc should become newsletter.admin.inc.

The require_once's at the beginning of newsletter.module are not very Drupal-like. I picked a random function from functions.inc, newsletter_get_vids(), and saw it was only used in admin.inc. It could be moved there.

The $(document).ready(function () { in newsletter.js should be converted to Drupal.behaviors: http://drupal.org/node/171213#behaviors, and the function should be namespaced as well. The entire file can be wrapped in the one closure binding $ to jQuery.

In the .info, the description should end in a full stop, and doesn't need to be wrapped in quotes.

The CSS file should like be renamed newsletter.theme.css, in accordance with http://drupal.org/node/1285604.

Also, double check your trailing whitespace, there are some in the CSS, JS, and README.txt.

ParisLiakos’s picture

Hello tim and thanks a lot for your time!
I am almost there,correcting the things you pointed.
I am stuck on the javascript thing but willl figure it out,just need to read the docs:)

about the

The require_once's at the beginning of newsletter.module are not very Drupal-like. I picked a random function from functions.inc, newsletter_get_vids(), and saw it was only used in admin.inc. It could be moved there.

just like i have it commented

//Loads functions needed.Used seperate files for organization purposes

I have only used different files for pure organization purposes.i dont want to clutter the .module file with thousands of lines of code,so i used .module for hooks only, admin.inc for administration forms only , user.inc for frontend forms and callbacks and, finally, functions.inc for reusable code.

If you still think its wrong,its ok i will move them to .module:)

Thanks again

tim.plunkett’s picture

Priority: Critical » Normal

Well first of all, if you leave it, the comment could be

// Loads functions needed. Used separate files for organization purposes.

Spelling and spacing are important.

My point about the functions in includes/functions.inc and includes/user.inc is that certain functions seem to be only used by certain include files.

The following files are only ever called in admin.inc:

newsletter_send_draft()
newsletter_load_drafts()
newsletter_lid_load()
newsletter_sid_load()
newsletter_tid_load()
newsletter_nid_load()
newsletter_get_tree()
newsletter_template_checked_terms()

They could easily be moved. And those are just an example, I imagine things could be chopped up further.

One other thing that comes to mind: you should create an "empty" master branch in Git, that contains a README.txt explaining why it is empty. An example is here: http://drupalcode.org/project/examples.git/blob/refs/heads/master:/READM...

Otherwise those checking out your module with Git will get an error.

ParisLiakos’s picture

Status: Needs work » Needs review

newsletter_*_load() functions are also used by the hook_menu's items.

Fixed the rest

derjochenmeyer’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new556 bytes

I added a patch that adds a "." at the end of the comment as suggested in #25 ;-) Doxygen and comment formatting conventions. But that realy shouldn't block this project application...

ParisLiakos’s picture

Thanks.Commited!

Btw it is moved to admin/config/system/newsletter since admin/config/newsletter
wont expose any link in the GUI and system was the closest section of config...i wish there was a mail one...but i checked htmlmail and other mail projects.since they use config/system i used that too:/

tim.plunkett’s picture

Status: Reviewed & tested by the community » Fixed

Awesome, looks much better.

I've granted you full project creation rights. Use this ability carefully!

Thank you for your patience.

ParisLiakos’s picture

Thanks a lot tim!
You and everyone for sparing some time for this:)

betovarg’s picture

subscribing... is this still being developed?

derjochenmeyer’s picture

This issue is still among the top search results for "Drupal newsletter D7".

The first link in this issue (http://drupal.org/sandbox/rootatwc/1212302) is dead and should be replaced with the full project URL...

derjochenmeyer’s picture

Issue summary: View changes

updated statistics (they are usable now)

derjochenmeyer’s picture

Issue summary: View changes

Updated issue summary.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

tbeckett’s picture

I love the Newsletter module. I find it much simplier and more feature complete than simplenews. One issue, I am trying to figure out how to get a list of the newletters I have sent in the past. I can't seem to see them. Their must be nodes created right? I have tried to use views to grab them, but no luck.

Anyone have any thoughts?

patrickd’s picture

@tbeckett this issue is only for project application matters and is already closed, please create a new support issue in the projects application queue for your request.

patrickd’s picture

Issue summary: View changes

Updated issue summary.