You are here

function simplenews_rules_action_send in Simplenews 7.2

Same name and namespace in other branches
  1. 8.2 simplenews_rules/simplenews_rules.rules.inc \simplenews_rules_action_send()
  2. 8 simplenews_rules/simplenews_rules.rules.inc \simplenews_rules_action_send()
  3. 7 simplenews_rules/simplenews_rules.rules.inc \simplenews_rules_action_send()
  4. 3.x simplenews_rules/simplenews_rules.rules.inc \simplenews_rules_action_send()

Action implementation, send a newsletter node.

File

simplenews_rules/simplenews_rules.rules.inc, line 188
Rules hooks for the Simplenews newsletter module.

Code

function simplenews_rules_action_send($node) {
  $newsletter = simplenews_newsletter_load($node->nid);
  if ($newsletter && ($newsletter->status != SIMPLENEWS_STATUS_SEND_PENDING || $newsletter->status != SIMPLENEWS_STATUS_SEND_PENDING)) {
    module_load_include('inc', 'simplenews', 'includes/simplenews.mail');
    simplenews_add_node_to_spool($node);
  }
}