Есть class Mail, function Send(), написл функцию в своем controller
Код:
static function sendEmail($id_requests_parts)
{
$id = Db::getInstance ()->getValue('SELECT `user_id` FROM `' . _DB_PREFIX_ . 'requests_parts` WHERE `id_requests_parts` = "'.$id_requests_parts.'"');
$customer = new Customer($id);
//var_dump($customer);
$customer->getByEmail('stadnyk.roman1@gmail.com');
//Set the variables for the template:
$templateVars['{firstname}'] = $customer->firstname;
$templateVars['{lastname}'] = $customer->lastname;
//$templateVars['{src_img}'] = _PS_BASE_URL_.__PS_BASE_URI__.'download/blog_belvg.png'; //Image to be displayed in the message
//echo $customer->id_lang;
$id_land = $customer->id_lang//Language::getIdByIso('en'); //Set the English mail template
$template_name = 'template'; //Specify the template file name
$title = Mail::l('Reminders are not sent inquiries'); //Mail subject with translation
$from = Configuration::get('PS_SHOP_EMAIL'); //Sender's email
$fromName = Configuration::get('PS_SHOP_NAME'); //Sender's name
$mailDir = dirname(__FILE__).'/mails/'; //Directory with message templates
$toName = $customer->firstname.' '.$customer->lastname; //Customer name
//$fileAttachment['content'] = file_get_contents(_PS_BASE_URL_.__PS_BASE_URI__.'download/fb.zip'); //File path
//$fileAttachment['name'] = 'fileAttachment'; //Attachment filename
//$fileAttachment['mime'] = 'application/zip'; //mime file type
$send = Mail::Send($id_land, $template_name, $title, $templateVars, $customer->email, $toName, $from, $fromName, NULL, NULL, $mailDir);
if ($send)
echo 'Done';
else
echo 'Error';
}
при попітке отправить пишет: Error
тестове сообщение с prestashop отпраляет успешно.