My auto generated newsletters are always marked as drafts (they go to the drafts tab) and are not sent automatically. I want to skip the step where I have to manually send them. Is this possible? How?

Thanks in advance.

Comments

Steve Dondley’s picture

Sorry for the slow response. I wasn't set up to get a notification when issues are posted. If I'm not mistaken, each newsletter allows you to set a default state for newsletter issues. Make sure yours is set to "send".

mmilano’s picture

I'm having this problem too. The setting is set to 'send' for this newsletter.

In General Setting, the 'Default selection for sending newsletters' is set to 'Send newsletter'

When I edit any of the drafts, they already are set to 'send newsletter'.

Is there anything else to consider?

mmilano’s picture

Not sure if this will help or not, but I created some test code based on some debug code I found in the module, and I can get it to send the newsletters fine when I call simplenews_digest_inject_node().

Like this:

  variable_set('simplenews_digest_start_time', time() -86400);
  variable_set('simplenews_digest_end_time', time() + 3600);
  variable_set('simplenews_digest_last_time_sent', time() - 86400);

  simplenews_digest_inject_node();

it just won't send when it runs on cron.

Steve Dondley’s picture

Status: Active » Postponed (maintainer needs more info)

OK, I reviewed the simplenews module code and my memory is coming back to me on this. You must give anonymous users the ability to create a newsletter. This is a simplenews module permission. Give that a shot. I'm pretty sure that's the problem.

mmilano’s picture

Hey Steve, I do appreciate the quick response.

I'll try it on my dev environment, but isn't this a huge security issue? Wouldn't anyone be able to pull up http://example.com/node/add/simplenews on any site running simplenews and send out newsletters to all subscribers?

Steve Dondley’s picture

There is a separate permission for creating newsletters.

HANIAK’s picture

It's an odd setting. I wouldn't figure that out by myself!
I'll give it a shot, and post the result...

HANIAK’s picture

It didn't work...
I'll activate also the permission to "send newsletter" (which makes much more sense than creating)
any other suggestion?

Steve Dondley’s picture

Let me make this explicit: the "send newsletter" is the permission you want to give anonymous users, not "create newsletter".

mmilano’s picture

Hah, same thing threw me off so I just enabled both and it worked fine. I'll take it back down to just send now.

Thanks Steve, you saved me a ton of time trying to figure that out on my own.

Steve Dondley’s picture

Thanks, and I will be sure to put a note in the README to document this problem.

HANIAK’s picture

Yeah, it worked! You only need to allow the anonymous user to "send newsletter" :)

Steve Dondley’s picture

Title: Newsleter is not sent » Documentation on how to configure permission needed
Component: Miscellaneous » Documentation
Assigned: Unassigned » Steve Dondley
Category: support » task
Status: Postponed (maintainer needs more info) » Active
andrewlevine’s picture

Steve, is the reason that 'send newsletter' has to be on for anonymous users because the node is being sent by cron.php (anonymous)? If so, it seems like the best solution would be to temporarily change the user to uid 1 before sending. Would you accept such a patch?

Thanks,
Andrew

Steve Dondley’s picture

Yeah, if you can write a patch that works and doesn't open up any security holes, that would be great.

Steve Dondley’s picture

Version: 5.x-1.0 » 6.x-1.x-dev

Fixed in Drupal 5 version. Still needed for drupal 6.