0

Using simplenews scheduler 7.x-1.0-beta2. I created a template newsletter and scheduled it to be sent daily.

I created a simple function to insert a dynamic value into the body of the newsletter edition that is created from the source template:

function hook_simplenews_scheduler_edition_node_alter($edition_node, $scheduler_node) {
  $edition_node->body['und'][0]['value'] = 'my new value';
}

My expectation was that when a newsletter edition is created from my newsletter template ($scheduler_node), the body of the new edition would say 'my new value'.

What actually happens is that the email sent to the newsletter subscribers says 'my new value', but the body of the newsletter edition node that is physically created still contains the body from the template.

Any suggestions?

0
function hook_simplenews_scheduler_edition_node_alter(&$edition_node, $scheduler_node) { 

    $my_arg = '-1day';
    $edition_node->body['und'][0]['value'] = views_embed_view('tracker03', 'page', $my_arg);    
    return $edition_node;

}

This does the trick.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.