/** * This function provides a hook to be able to write special parses for provider emails that are difficult to work with * If you want to extend this functionality - write a new function and call it from here */ function SpecialMessageParsing(&$content, &$attachments, $config) { extract($config); if (preg_match('/You have been sent a message from Vodafone mobile/', $content)) { VodafoneHandler($content, $attachments); //Everything for this type of message is handled below return; } if ($message_start) { StartFilter($content, $message_start); } if ($message_end) { EndFilter($content, $message_end); } if ($drop_signature) { $content = remove_signature($content, $sig_pattern_list); } if ($prefer_text_type == "html" && count($attachments["cids"])) { ReplaceImageCIDs($content, $attachments); } if (!$custom_image_field) { ReplaceImagePlaceHolders($content, $attachments["html"], $config); } else { $customImages = array(); foreach ($attachments["html"] as $value) { preg_match("/src=['\"]([^'\"]*)['\"]/", $value, $matches); array_push($customImages, $matches[1]); } return $customImages; } return NULL; }
/** * This function provides a hook to be able to write special parses for provider emails that are difficult to work with * If you want to extend this functionality - write a new function and call it from here */ function SpecialMessageParsing(&$content, &$attachments, $config) { if (preg_match('/You have been sent a message from Vodafone mobile/', $content)) { VodafoneHandler($content, $attachments); //Everything for this type of message is handled below return; } if ($config["MESSAGE_START"]) { StartFilter($content, $config["MESSAGE_START"]); } if ($config["MESSAGE_END"]) { EndFilter($content, $config["MESSAGE_END"]); } if ($config["DROP_SIGNATURE"]) { RemoveSignature($content, $config["SIG_PATTERN_LIST"]); } if ($config["PREFER_TEXT_TYPE"] == "html" && count($attachments["cids"])) { ReplaceImageCIDs($content, $attachments); } if (!$config['CUSTOM_IMAGE_FIELD']) { ReplaceImagePlaceHolders($content, $attachments["html"], $config); } else { $customImages = array(); foreach ($attachments["html"] as $value) { preg_match("/src=['\"]([^'\"]*)['\"]/", $value, $matches); array_push($customImages, $matches[1]); } return $customImages; } return NULL; }
/** * This function provides a hook to be able to write special parses for provider emails that are difficult to work with * If you want to extend this functionality - write a new function and call it from here */ function SpecialMessageParsing(&$content, &$attachments) { $config = GetConfig(); if (preg_match('/You have been sent a message from Vodafone mobile/', $content)) { VodafoneHandler($content, $attachments); //Everything for this type of message is handled below return; } if ($config["MESSAGE_START"]) { StartFilter($content, $config["MESSAGE_START"]); } if ($config["MESSAGE_END"]) { EndFilter($content, $config["MESSAGE_END"]); } if ($config["DROP_SIGNATURE"]) { RemoveSignature($content, $config["SIG_PATTERN_LIST"]); } if ($config["PREFER_TEXT_TYPE"] == "html" && count($attachments["cids"])) { ReplaceImageCIDs($content, $attachments); } ReplaceImagePlaceHolders($content, $attachments["html"]); }