//send mail to owner if status set to 'Job Dispatched' if($ _POST['new_status'] == 10){ $ owner_email = get_option('purch_log_email'); $ result = $ wpdb->get_results('select wsf1.value as firstname , wsf2.value as lastname , wsf3.value as email from XXXX2_wpsc_purchase_logs wpl left join XXXX2_wpsc_submited_form_data wsf1 ON wsf1.log_id = wpl.id AND wsf1.form_id = 2 left join XXXX2_wpsc_submited_form_data wsf2 ON wsf2.log_id = wpl.id AND wsf2.form_id = 3 left join XXXX2_wpsc_submited_form_data wsf3 ON wsf3.log_id = wpl.id AND wsf3.form_id = 9 where wpl.id = "'.$ _POST['id'].'"'); $ message = '<script type="application/json+trustpilot">
{‘ ."\n" ."\n" .’"recipientEmail": ‘.’"’.$ result[0]->email.’"’."," ."\n" ."\n" .’"recipientName": ‘.’"’.$ result[0]->firstname."".$ result[0]->lastname.’"’."," ."\n" ."\n" .’"referenceId": ‘.’"’.$ _POST[‘id’].’"’."," ."\n" ."\n" .’ }
‘;
$ from = "mysite.dk <info@mysite.dk>"; $ to = $ owner_email; $ subject = "Trust Pilot";
// // $ headers = "From:" . $ from; $ headers = "From: " . $ from . "\r\n"; $ headers.= "Content-Type: text/plain;charset=utf-8\r\n";
//wp_mail($ owner_email, 'New Dispatched Job', $ message);
// Trust-Pilot
// mail(‘xxxxx@xxxxxx.trustpilot.dk’, $ subject, $ message, $ headers); mail(‘XXX@adr.dk’, $ subject, $ message, $ headers); }