Advertisement
julien731

Untitled

Jul 22nd, 2016
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.84 KB | None | 0 0
  1. add_action( 'phpmailer_init', 'wpas_custom_email_notification_delimiter', 99 );
  2. /**
  3.  * Add the e-mail notification delimiter at the very beginning of e-mails
  4.  *
  5.  * @param object $phpmailer
  6.  * @return void
  7.  */
  8. function wpas_custom_email_notification_delimiter( $phpmailer ) {
  9.  
  10.     if ( isset( $phpmailer->Subject ) && false !== strpos( $phpmailer->Subject, 'YOUR_FIXED_STRING' ) ) {
  11.         $phpmailer->Body = str_replace( '<!-- AS_HEADER -->', '<div style="color:#b5b5b5">##- Please type your reply above this line -##</div>', $phpmailer->Body );
  12.     }
  13.  
  14. }
  15.  
  16. add_action( 'plugins_loaded', 'wpas_remove_default_email_delimiter', 25 );
  17. /**
  18.  * Remove the default delimiter
  19.  *
  20.  * @return void
  21.  */
  22. function wpas_remove_default_email_delimiter() {
  23.     remove_filter( 'wpas_email_notifications_body', array( WPAS_Email::get_instance(), 'add_delimiter' ), 10 );
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement