1. Home
  2. Docs
  3. Subscribe2
  4. Hooks, API & Customization
  5. s2_confirm_email

s2_confirm_email

Introduced in version 9.1. It allows the confirmation email containing the confirmation link to subscribe or unsubscribe to be filtered. The filter allows for differentiation between subscribers and unsubscribes. It also allows for alteration or a complete change of the email template defined in Subscribe2->Settings under the Templates tab.

function change_confirm( $body, $action ) {
    // $body is the template email text from the Subscribe2->Settings page in the Templates tab
    // $action is '1' if the action is subscribing and '0' if the action is unsubscribing
    // you can append to the $body variable, use string replace functions to return an entirely different template
    return $body . 'This is some extra added text from the extension function';
}
add_action('s2_confirm_email', 'change_confirm', 10, 2);
Was this article helpful to you? Yes No

How can we help?