function simplenews_rules_action_unsubscribe in Simplenews 8.2
Same name and namespace in other branches
- 8 simplenews_rules/simplenews_rules.rules.inc \simplenews_rules_action_unsubscribe()
- 7.2 simplenews_rules/simplenews_rules.rules.inc \simplenews_rules_action_unsubscribe()
- 7 simplenews_rules/simplenews_rules.rules.inc \simplenews_rules_action_unsubscribe()
- 3.x simplenews_rules/simplenews_rules.rules.inc \simplenews_rules_action_unsubscribe()
Action Implementation: Unsubscribe an e-mail adress to a newsletter.
File
- simplenews_rules/
simplenews_rules.rules.inc, line 211 - Rules hooks for the Simplenews newsletter module.
Code
function simplenews_rules_action_unsubscribe($args, $settings) {
if ($args['language'] == LANGUAGE_NONE) {
$args['language'] = NULL;
}
$confirmation = simplenews_rules_map_confirmation($args);
// Pass the call forward.
\Drupal::service('simplenews.subscription_manager')
->unsubscribe($args['mail'], $args['tid'], $confirmation, $args['source'], $args['language']);
}