Project:Simplenews Scheduler
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

This is creating the copies of the newsletter as nodes at the correct time, but is not sending the newsletter. They are listed under the Scheduled newsletter tab as sent when they have not gone out.

When I click the edit tab on a newly created node, the Don't send now radio button is selected. I can then manually change it to Send newsletter and submit, and it then sends, but I thought this was supposed to send automatically.

I am trying to send a daily email and am using simplenews 5.x-1.3.

Comments

#1

Heya, are the entries showing up in the simplenews content admin panel?

#2

This is essentially the crux of the sending mechanism (which is called from a hook_cron)

function simplenews_scheduler_new_edition($sched_nid) {
...

  // trigger it for sending
  $node->send = 1;
  node_save($node);

Probably need to check with the simplenews crew to see if this is a viable way to force a send of a node

#3

Yes, this should work.

#4

Hmmm well it doesnt :( have to keep looking i guess, is there something in the simplenews SQL tables that needs to be tweaked?

#5

please try again with simplenews 1.5 and the latest dev release of this module

#6

Status:active» postponed (maintainer needs more info)

let me know how your test with 1.5 goes, works OK here

#7

Still not working for me. Latest dev version of simplenews scheduler, simplenews 1.5, date 2.4.

It's creating the nodes for the new editions, but not sending the original or the editions.

Getting this error in watchdog:

mysql_fetch_array(): supplied argument is not a valid MySQL result resource

#8

I wonder if these two lines are causing the problem

  $node = node_build_content($node, FALSE, FALSE);
 
  $content = drupal_render($node->content);

Neither is needed and node_build_content() modifies the node possibly in a way that makes it incompatible with node_save().

#9

the reason why i'm re-rendering the node content is because if you have some dynamic input filter like the insert-view filter, then you need to re-execute that filter when you are creating a new newsletter.

for example, the news letter contains a view of last 10 articles on your site, which is introduced when rendering the node, so this node needs to be re-rendered each time a newsletter edition is created

for example

<h2>Articles since last edition</h2>
[insert_view:myview]

so i'm not sure what todo here, there seems to be an issue with views caching data too..

#10

But the new node is not being render, it is the old/original node. I wonder does simplenews use node_view to render the node (which would be proper)?

#11

I have the same problem, but I noticed that after the first issue of the newsletter (that is correctly sent), the second one (i.e., a day after) is regarding an automatic 'saved node' made by an anonymous user.

So... should it be worthy to give "send newsletter" grant to anonymous user to send it effectively???

#12

Priority:critical» normal
Status:postponed (maintainer needs more info)» needs work

Hi again.

I *SOLVED* the problem and the module works great with Insert View integration.

As I stated before, after the creator of the scheduling action (the admin?) left the backend, the node is saved automatically at a prearranged date/hour. This saving task is accomplished by the anonymous user (!). So, to solve immediately the problem, grant "send newsletter" to anonymous, and the newsletter is sent as scheduled.

Maybe... it should be better that the code is a little bit rewritten to avoid this workaround.

Alessandro

#13

Status:needs work» fixed

Actually the node is saved with a uid of the parent (original newsletter), i've stepped thru this with a debugged as anonymous accessing /cron.php (also double checked that i was logged out) and with my latest tweaks seemed to be fine.

there was a silly bug fetching the simplenews schedule :(

please try again on the new dev release (dec15)

#14

Status:fixed» closed (fixed)

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