Guest User

Untitled

a guest
May 16th, 2018
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.90 KB | None | 0 0
  1. mdc_log("\n\n\n\n\n\n\n Checking if wp_mail is already loaded....\n\n\n\n\n\n");
  2.  
  3. if ( ! function_exists('wp_mail') ) {
  4.  
  5. mdc_log("\n\n\n\n\n\n\n Custom wp_mail loading....\n\n\n\n\n\n");
  6.    
  7.     function wp_mail( $to, $subject, $message, $headers = '', $attachments = array() ) {
  8.  
  9.         global $mdcIS, $mdc_mail_from_name, $mdc_mail_from_addr, $mdc_mail_through_IS_token;
  10.  
  11.         $sendThroughIS = (strpos($subject, $mdc_mail_through_IS_token) && isset($_SESSION['i4wuser']['Id']) && is_numeric($_SESSION['i4wuser']['Id']));
  12.  
  13.         mdc_log("\n\n\nSending Mail Through InfusionSoft: " . $sendThroughIS);
  14.  
  15.         if (!$sendThroughIS) {
  16.             return wp_mail_original($to, $subject, $message, $headers, $attachments);
  17.         }
  18.  
  19.         $subject = str_replace($mdc_mail_through_IS_token, '', $subject);
  20.  
  21.         return $mdcIS->app->sendEmail( $contactIds, $mdc_mail_from_addr, $to, '', '', 'HTML', $subject, $message, striptags($message) );
  22.  
  23.     }
  24.  
  25. }
Add Comment
Please, Sign In to add comment