Simplenews + sched_act

SaxxIng - August 14, 2007 - 13:29
Project:Simplenews
Version:HEAD
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

Is it possible in a future release to integrate the great simplenews module with the new scheduled_action (like sched_act) module?
I suppose (hope) that this isn't too complex (for whom mantain and know well simplenews and drupal code) but it finally offers a clean and efficiently method to obtain the necessary scheduled simplenews! (at the moment is only possible to schedule publish/unplush/sticky/unsticy etc a simplenews node, but not schedule sending).
However thanks a lot for this great module,
Saxx

#1

Sutharsan - August 14, 2007 - 13:45
Version:5.x-1.1» HEAD

Thanks for the tip! The ability to schedule the submission of newsletters is on my wish list. I don't expect to implement this in a 5.x version will certainly have a look at it for 6.x developments.

#2

aexl_konzepto.net - February 9, 2008 - 02:10

#219544: Actions to do scheduled sending might provide a solution

#3

medieval111 - June 8, 2009 - 13:08

I'm using Drupal 6.11 with Simplenews 6.x-1.0-rc6.

Maybe it's not the best solution, but to add scheduled sending (sending the letter only once), I use the Scheduler module to publish the newsletter-node at a specific date/time.

To send only published newsletters when the cron runs, I added one if-statement to simplenews.module:

<?php
function simplenews_get_spool($status, $nid = NULL, $vid = NULL, $limit = 999999) {
 
$messages = array();

 
$result = db_query_range("SELECT * FROM {simplenews_mail_spool} s WHERE s.status = %d ORDER BY s.timestamp ASC", $status, 0, $limit);
  while (
$data = db_fetch_array($result)) {
   
$node = node_load($data['nid']);      //ADDED!
   
if ($node->status) {                  //ADDED!
       
$message = array();
        foreach (
$data as $key => $value) {
         
$message[$key] = $value;
        }
       
$messages[$data['msid']] = $message;
    }                                    
//ADDED!
 
}
  return
$messages;
}
?>

 
 

Drupal is a registered trademark of Dries Buytaert.