The scheduler options does not show up on the 'Newsletter' section under 'Send Actions'. The only actions there are 'Send one test newsletter to the test address' and 'Send newsletter'.

All required modules are installed and permissions are set.

Installed mail modules: SimpleNews 6.x-2.x-dev, Simplenews action 6.x-2.x-dev, Simplenews roles 6.x-0.1, Simplenews Content Selection 6.x-1.6, HTML Mail 6.x-1.3.

Comments

data77’s picture

Title: Scheduler options does now show up » Scheduler options does not show up
data77’s picture

Title: Scheduler options does not show up » Scheduler options doesn't show up
data77’s picture

Title: Scheduler options doesn't show up » Scheduler options missing

sorry for all the title changes, too tired!

sgabe’s picture

Title: Scheduler options missing » Support for Simplenews 6.x-2.x
Version: 6.x-1.0-beta3 » 6.x-2.x-dev
Component: User interface » Code
Category: bug » support
Priority: Major » Normal

I am afraid Simplenews 6.x-2.x is unsupported at the moment and this is a support request.

data77’s picture

Any idea when 6.x-2.x will be supported? Have a client that needs this functionality and I want be able to tell them when they can have it.

sgabe’s picture

Maybe in february, but I have a few more important task to finish so I can't promise anything. Of course if someone would come along and provide a patch that could speed up the process.

bbence’s picture

The main difference which prevents simplenews scheduler from functioning properly is that simplenews 2.x now adds its options for a newsletter node a separate tab instead of adding the form elements to the end of the node edit tab.
So this module tries to append it's settings to the node edit tab and also it tries to save it's settings when the node is updated.

I also needed a quick solution, so I had to end up "hacking" the saving part of this module into the simplenews module, but it works more or less.
Other change is to make the settings appear on the separate tab of simplenews 2.x.

1. modify simplenews_scheduler.module
In line 54-56 (function simplenews_scheduler_form_alter) should look like this:

global $user;
// Add schedule settings to the newsletter edit form.
if (isset($form['simplenews']) && user_access('send scheduled newsletters')) {

58-67:

// Set the default values.

$result = db_query("SELECT * FROM {simplenews_scheduler} WHERE nid = %d", arg(1));
$row = db_fetch_array($result);
if ($row) {
$scheduler = $row;
}

$form['simplenews']['send']['#options'][SIMPLENEWS_COMMAND_SEND_NONE] = t("Don't send now or stop sending");

2. Modify simplenews.module

After line 517:
(after the following block in function simplenews_node_tab_send_form_submit:
elseif ($values['simplenews']['send'] == SIMPLENEWS_COMMAND_SEND_TEST) {
// Send test newsletter to test address(es)
simplenews_send_test($node);
}
)

// ****************** SIMPLENEWS HACK FOR SCHEDULER ****************************

$send = $node->simplenews['send'];
$activated = $node->simplenews['activated'];
$interval = $node->simplenews['interval'];
$start_date = $node->simplenews['start_date'];
$stop = $node->simplenews['stop'];
$stop_date = $node->simplenews['stop_date'];
$stop_edition = $node->simplenews['stop_edition'];
// Change activation status if necessary.
switch ($send) {
case 0:
case 1:
$activated = 0;
break;
case 3:
$activated = 1;
break;
}
// Convert the user time back to GMT time and use that as our record.
$start_date = date_convert($start_date, DATE_DATETIME, DATE_UNIX, date_default_timezone_name());
$stop_date = date_convert($stop_date, DATE_DATETIME, DATE_UNIX, date_default_timezone_name());

if (!$node->is_edition) {
$result = db_query("INSERT INTO {simplenews_scheduler} (nid, activated, `interval`, start_date, stop, stop_date, stop_edition) VALUES (%d, %d, '%s', %d, %d, %d, %d)
ON DUPLICATE KEY UPDATE last_run = 0, activated = %d, `interval` = '%s', start_date = %d, stop = %d, stop_date = %d, stop_edition = %d",
$node->nid, $activated, $interval, $start_date, $stop, $stop_date, $stop_edition, $activated, $interval, $start_date, $stop, $stop_date, $stop_edition, $node->nid);
if (!$result) {
drupal_set_message(t('Saving or updating schedule settings for @title has been unsuccessful.', array('@title' => $node->title)), 'error');
}
}

// ********** SIMPLENEWS HACK FOR SCHEDULER ****************************

Again, it's a very dirty and very rough hack, but it can point to some places where this incompatibility can be resolved (i.e. overriding / hooking into the form validation for the simplenews module to make the saving also work as intended).

I'm no expert at creating patches, I only wanted to post this "solution" in case someone badly needs it like I did. :)

Mat77’s picture

Any news?

Didn't try the hack in #7 yet, I'd rather use a "clean" solution if it exists.

data77’s picture

Also wondering if there's any progress for this issue...thanks in advance.

sgabe’s picture

@bbence: Can you please provide a patch?

Mat77’s picture

The hack in #7 worked for me.

Would be great to update this module though...

dgtlmoon’s picture

Sorry all, I need to spend some time on this soon :(

Onfire60’s picture

Hi All,

I have patched my files from the above example in #7 and will post them here. They work with Simplenews Scheduler 6.x-1.0-beta3 and Simplenews 6.x-2.0-alpha1. Hope this helps someone.

kirkcaraway’s picture

I tried this but couldn't get the scheduler to show up, so I had to revert back to Simplenews 1.x.

bmango’s picture

subscribing

splash112’s picture

subscribe

dgtlmoon’s picture

Status: Active » Needs review

Try the latest 6.x-2.x dev release

splash112’s picture

Thanks for the port!

Seems you forgot to add 'php_eval', array('type' => 'blob')) to the simplenews_scheduler_schema().

Use the Insert View module to insert some views to my Newsletter, nut somehow it seems that the View images will not display, even with the mime module enabled. Anybody got this working?

- edit, sorry, worked as expected. Just not in my mail programs...

Thanks

PB1’s picture

Version: 6.x-2.x-dev » 6.x-2.0-beta3
Status: Needs review » Reviewed & tested by the community

Hello.

Thanks for the new version of Simplenews scheduler, dgtlmoon.

Simplenews Scheduler is now working for me again, using the following setup:

- SimpleNews 6.x-2.x-dev (2011-Jun-11)
- Simplenews Scheduler 6.x-2.0-beta3 (2011-May-31)
- Mime Mail 6.x-1.0-beta1 (2011-Jun-04)

This is running on:

- Drupal 6.22
- MySQL 5.1.49
- PHP 5.3.3
- Apache 2.2.13
- openSUSE 11.3

From my perspective, this issue has been addressed. I'm not sure about the issue raised by @splash112 in #18, though. I'm going ahead and setting this issue to R&TBTC.

Pete

dgtlmoon’s picture

Just waiting to resolve this possible bug with our SQL #970942: Saving or updating schedule settings for has been unsuccessful. before making a release, then we should be good to go, Please help test the patches on there, even if you are on MySQL.

sgabe’s picture

Status: Reviewed & tested by the community » Closed (fixed)

Closing this, we can continue in separate issues if anything comes up.