bp_send_email_delivery_class

Filter the email delivery class.

Description

apply_filters( 'bp_send_email_delivery_class', (string) $bp_phpmailer, (string) $email_type, (array|string) $to, (array) $args ); 

Defaults to PHPMailer" title="BP_PHPMailer" class="code class">BP_PHPMailer, which as you can guess, implements PHPMailer.

Parameters (4)

0. $bp_phpmailer (string) => 'BP_PHPMailer'
The email delivery class name.
1. $email_type (string)
Type of email being sent.
2. $to (array|string)
Array or comma-separated list of email addresses to the email to.
3. $args — Optional. (array)

Usage

To run the hook, copy the example below.
  1. $bp_phpmailer = apply_filters( 'bp_send_email_delivery_class', $bp_phpmailer, $email_type, $to, $args ); 
  2.  
  3. if ( !empty( $bp_phpmailer ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the bp_send_email_delivery_class callback 
  2. function filter_bp_send_email_delivery_class( $bp_phpmailer, $email_type, $to, $args ) { 
  3. // make filter magic happen here... 
  4. return $bp_phpmailer
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'bp_send_email_delivery_class', 'filter_bp_send_email_delivery_class', 10, 4 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'bp_send_email_delivery_class', 'filter_bp_send_email_delivery_class', 10, 4 ); 

Defined (1)

The filter is defined in the following location(s).

/bp-core/bp-core-functions.php  
  1. $delivery_class = apply_filters( 'bp_send_email_delivery_class', 'BP_PHPMailer', $email_type, $to, $args );