function simplenews_rules_action_send in Simplenews 8
Same name and namespace in other branches
- 8.2 simplenews_rules/simplenews_rules.rules.inc \simplenews_rules_action_send()
- 7.2 simplenews_rules/simplenews_rules.rules.inc \simplenews_rules_action_send()
- 7 simplenews_rules/simplenews_rules.rules.inc \simplenews_rules_action_send()
- 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)) {
\Drupal::service('simplenews.spool_storage')
->addFromEntity($node);
}
}