src/mailbot.php
/* PROCESS EMAIL - logic to parse email intention before setting service parameters */
PROCESS EMAIL - logic to parse email intention before setting service parameters
PROCESS EMAIL - logic to parse email intention before setting service parameters
function process_email($email_content) {
$parsed_content = strtoupper(str_replace(" ","",get_subject($email_content)));
$parsed_content .= strtoupper(str_replace(" ","",get_message($email_content)));
if (strpos($parsed_content, "FOODNEARBY") !== false)
        set_service("FOODNEARBY",$email_content);
else if (strpos($parsed_content, "DELIVEROO") !== false)
        set_service("DELIVEROO",$email_content);
else if (strpos($parsed_content, "RESTAPI") !== false)
        set_service("RESTAPI",$email_content);
else set_service("NOACTION",$email_content);}
function process_email ( $ email_content ) { $ parsed_content = strtoupper ( str_replace ( " " , " " , get_subject ( $ email_content ) ) ) ; $ parsed_content .= strtoupper ( str_replace ( " " , " " , get_message ( $ email_content ) ) ) ; if ( strpos ( $ parsed_content , " FOODNEARBY " ) !== false ) set_service ( " FOODNEARBY " , $ email_content ) ; else if ( strpos ( $ parsed_content , " DELIVEROO " ) !== false ) set_service ( " DELIVEROO " , $ email_content ) ; else if ( strpos ( $ parsed_content , " RESTAPI " ) !== false ) set_service ( " RESTAPI " , $ email_content ) ; else set_service ( " NOACTION " , $ email_content ) ; }
PROCESS EMAIL - logic to parse email intention before setting service parameters
PROCESS EMAIL - logic to parse email intention before setting service parameters