Wednesday, June 29, 2011

Stop Simplenews from sending out a newsletter ( Drupal )

This tip is for people using Drupal and a module called Simplenews for maintaining and sending out newsletters to an email list.

There might come a time when you need to stop simplenews from sending newsletters - maybe because of issues with the module or the Drupal site, or you accidentally sent the wrong newsletter to a certain list of users. Whatever the reason, below is a quick way of stopping Simplenews.

  1. Backup your database first. You can use a module called Backup and Migrate to do so.

  2. Open phpMyAdmin, and look for under your Drupal site's database the simplenews_newsletter table.

  3. Determine the node id of the newsletter you are sending ( going into the edit page would show you the node id on the url ). Look for that node id on the simplenews_newsletter table, and click on the edit button on the left of the row ( pencil icon ).

  4. Change the s_status from 1 ( which means sending ) to either 0 ( unsent ) or 2 ( sent ).

  5. Empty the simplenews_mail_spool table ( this is where all the email addresses and status per message is stored ).

    You can use TRUNCATE to do this, as in the code below:

    TRUNCATE TABLE simplenews_mail_spool

6 comments:

  1. Anonymous6:40 PM

    Thanks does this work for Drual 7? Its hard to believe that there is no other way to stop simplenews other than editing the database.!! Thats a solution for site devs not content editors!.

    This type of thing is a major problem for Drupal and its a common problem with contrib modules. A module that has send functionality but no way to cancel the stop is like a car with an accelerator but no brakes. Its not ready for prime time.

    ReplyDelete
  2. I have not used Simplenews on Drupal 7, so cannot comment on whether it works the same way - but assuming that the Drupal 7 version is a port of what is in 6, then the function to stop sending from the Drupal admin would be non-existent as well.

    I agree that even the most popular contrib modules have these missing functions that should be there out of the box.

    Best of luck with your issue, I will update the post if I find anything that would be useful regarding Simplenews and this issue in particular.

    ReplyDelete
  3. Thanks! Saved my day.

    Indeed, it is hard to understand why a simple "Cancel" button is not available when the steps to cancel are so clear cut.

    ReplyDelete
  4. Anonymous7:15 AM

    I can verify this works in Drupal 7 as well. Just did it with Drupal 7.12 and Simplenews 7.x 1.0 beta 1. Thanks for the guide!

    ReplyDelete
  5. Edgar DeLoa8:22 PM

    Thanks for sharing, and in such a concise manner ... took all of 60 seconds to read your post and unsend the emails.

    Works with D7

    ReplyDelete
  6. Anonymous1:06 AM

    This is a very useful article, Great work drupal

    ReplyDelete