public function createErrorEmail($ResultDescription) { //For certain errors, send the admin email if (stripos($ResultDescription, "contradicts information") !== false) { //Send email $objEmail = new EmailQueue(); $objEmail->htmlbody = "Amazon Error: " . $ResultDescription; $objEmail->subject = "Amazon Error"; $orderEmail = _xls_get_conf('ORDER_FROM', ''); $objEmail->to = empty($orderEmail) ? _xls_get_conf('EMAIL_FROM') : $orderEmail; Yii::log($objEmail->htmlbody, 'error', 'application.' . __CLASS__ . "." . __FUNCTION__); if (!$objEmail->save()) { Yii::log("Error saving Email " . print_r($objEmail->getErrors(), true), 'error', 'application.' . __CLASS__ . "." . __FUNCTION__); } } }