Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mdc_log("\n\n\n\n\n\n\n Checking if wp_mail is already loaded....\n\n\n\n\n\n");
- if ( ! function_exists('wp_mail') ) {
- mdc_log("\n\n\n\n\n\n\n Custom wp_mail loading....\n\n\n\n\n\n");
- function wp_mail( $to, $subject, $message, $headers = '', $attachments = array() ) {
- global $mdcIS, $mdc_mail_from_name, $mdc_mail_from_addr, $mdc_mail_through_IS_token;
- $sendThroughIS = (strpos($subject, $mdc_mail_through_IS_token) && isset($_SESSION['i4wuser']['Id']) && is_numeric($_SESSION['i4wuser']['Id']));
- mdc_log("\n\n\nSending Mail Through InfusionSoft: " . $sendThroughIS);
- if (!$sendThroughIS) {
- return wp_mail_original($to, $subject, $message, $headers, $attachments);
- }
- $subject = str_replace($mdc_mail_through_IS_token, '', $subject);
- return $mdcIS->app->sendEmail( $contactIds, $mdc_mail_from_addr, $to, '', '', 'HTML', $subject, $message, striptags($message) );
- }
- }
Add Comment
Please, Sign In to add comment