Как правильно прописать кодировку Ajax+PHP для отправки писем с диакритическими знаками?
Всем привет! Уже две недели бьюсь с проблемой: у меня сайт на Опенкарт 2.3 с двумя языками: русский и румынский, есть страница с которой отправляется заявка на печать через ajax formData.Если на странице русский язык письма уходят корректно админу и клиенту, а если на странице выбран румынский, то письмо клиенту не уходит в том случае когда в выбранных параметрах калькулятора есть слова с диакритическими знаками. Админу у меня всегда на русском письмо уходит поэтому с этим проблем нет, а клиенту в зависимости от выбранного языка. Переменные у меня двух видов: из языкового файла - с ними естественно проблем нет, и те что тянутся из базы данных - вот они и не отправляются((( Я новичок, поэтому прошу помощи - то ли заголовки какие-то надо прописать, то ли с кодировкой что-то, сама перебровала всякие варианты, но возможно что-то делаю не так, просто пальцем в небо еще долго можно искать. Помогите) Код js:
function call(form) {
//создаем экземпляр класс FormData, тут будем хранить всю информацию для отправки
var formData = new FormData();
//присоединяем остальные поля
formData.append("name", $("input#name").val());
formData.append("email", $("input#email").val());
formData.append("phone", $("input#phone").val());
formData.append("dostavkafz", $("select#dostavkafz").val());
formData.append("addrdost", $("textarea#addr-dost").val());
formData.append("numer", $("input#numer").val());
formData.append("price_itog", olditogsum);
if ($("select#dostavkafz").val() == config_delivery_one) {
formData.append("delivery_one", $("input#delivery_one").val());
formData.append("delivery_one2", config_delivery_one2);
}
if ($("select#dostavkafz").val() == config_delivery_two) {
formData.append("delivery_two", $("input#delivery_two").val());
}
if ($("select#dostavkafz").val() == config_delivery_three) {
formData.append("delivery_three", $("input#delivery_three").val());
}
formData.append("text_telephone", text_telephone);
formData.append("text_delivery", text_delivery);
formData.append("text_comment", text_comment);
formData.append("text_no", text_no);
formData.append("config_canvas_cover_one", config_canvas_cover_one);
formData.append("config_canvas_cover_two", config_canvas_cover_two);
formData.append("text_number_of_persons", text_number_of_persons);
formData.append("text_canvas_printing_options_mail", text_canvas_printing_options_mail);
formData.append("text_canvas_orientation", text_canvas_orientation);
formData.append("text_canvas_size", text_canvas_size);
formData.append("text_type_of_stretch", text_type_of_stretch);
formData.append("text_suspension_system", text_suspension_system);
formData.append("text_сanvas_cover", text_сanvas_cover);
formData.append("text_making_a_baguette", text_making_a_baguette);
formData.append("text_design_processing", text_design_processing);
formData.append("text_packaging", text_packaging);
formData.append("your_image", your_image);
formData.append("text_order_production_time", text_order_production_time);
formData.append("text_total_cost_of_the_order", text_total_cost_of_the_order);
formData.append("text_the_cost_of_the_canvas", text_the_cost_of_the_canvas);
formData.append("text_the_cost_of_the_delivery", text_the_cost_of_the_delivery);
formData.append("text_hello_mail", text_hello_mail);
formData.append("text_text_mail", text_text_mail);
formData.append("text_var_mail", text_var_mail);
formData.append("text_order_production_day", text_order_production_day);
formData.append("text_order_production_days", text_order_production_days);
formData.append("text_currenncy_pageorder", text_currenncy_pageorder);
for (var ihp = 1; ihp <= numerh; ihp++) {
// var orientation = "fz-or-holin".concat(ihp);
formData.append("ihp", ihp);
formData.append(
"orientation",
$("input#fz-or-holin".concat(ihp)).val()
);
// var orientation2 = "fz-or-hol-in".concat(ihp);
formData.append(
"orientation2",
$("input#fz-or-hol-in".concat(ihp)).val()
);
// var kol_lic = "fz-or-kollic-in".concat(ihp);
formData.append(
"kol_lic",
$("input#lico".concat(ihp)).val()
);
// var size_holst = "fz-raz-hol-in".concat(ihp);
formData.append(
"size_holst",
$("input#fz-raz-hol-in".concat(ihp)).val()
);
// var type_scretch = "fz-vid-natin".concat(ihp);
formData.append(
"type_scretch",
$("input#fz-vid-natin".concat(ihp)).val()
);
// var type_scretch2 = "fz-vid-nat-in".concat(ihp);
formData.append(
"type_scretch2",
$("input#fz-vid-nat-in".concat(ihp)).val()
);
// var suspension_system = "fz-pod-sysin".concat(ihp);
formData.append(
"suspension_system",
$("input#fz-pod-sysin".concat(ihp)).val()
);
// var suspension_system2 = "fz-pod-sys-in".concat(ihp);
formData.append(
"suspension_system2",
$("input#fz-pod-sys-in".concat(ihp)).val()
);
// var сanvas_cover = "fz-pok-holin".concat(ihp);
formData.append(
"canvas_cover",
$("input#fz-pok-holin".concat(ihp)).val()
);
// var сanvas_cover2 = "fz-pok-hol-in".concat(ihp);
formData.append(
"canvas_cover2",
$("input#fz-pok-hol-in".concat(ihp)).val()
);
// var making_a_baguette = "fz-bagetin".concat(ihp);
formData.append(
"making_a_baguette",
$("input#fz-bagetin".concat(ihp)).val()
);
// var making_a_baguette2 = "fz-baget-in".concat(ihp);
formData.append(
"making_a_baguette2",
$("input#fz-baget-in".concat(ihp)).val()
);
// var baget_src = "fz-baget-src".concat(ihp);
formData.append(
"baget_src",
$("input#fz-baget-src".concat(ihp)).val()
);
// var design_processing = "fz-dizobin".concat(ihp);
formData.append(
"design_processing",
$("input#fz-dizobin".concat(ihp)).val()
);
// var design_processing2 = "fz-dizob-in".concat(ihp);
formData.append(
"design_processing2",
$("input#fz-dizob-in".concat(ihp)).val()
);
// var packaging = "fz-upak-holin".concat(ihp);
formData.append(
"packaging",
$("input#fz-upak-holin".concat(ihp)).val()
);
// var packaging2 = "fz-upak-hol-in".concat(ihp);
formData.append(
"packaging2",
$("input#fz-upak-hol-in".concat(ihp)).val()
);
// var price_holst = "price-holst-in".concat(ihp);
formData.append(
"price_holst",
$("input#price-holst-in".concat(ihp)).val()
);
// var message = "message".concat(ihp);
formData.append(
"message",
$("textarea#message".concat(ihp)).val()
);
// var file_v = "file_v".concat(ihp);
jQuery.each($("#uploaded-file".concat(ihp))[0].files, function (i, file) {
formData.append("file_v", file);
});
}
for (var pair of formData.entries()) {
console.log(pair[0]+ ', ' + pair[1]);
}
//отправляем через ajax ПРИКРУТИТЬ ОТПРАВКУ ФОРМЫ
$.ajax({
url: "index.php?route=pageorder/pageorder/sendMail",
type: "POST",
dataType: "json",
cache: false,
contentType: false,
processData: false,
data: formData,
//указываем что отправляем
beforeSend: function () {
$("#itoghp").hide();
$("#itoghp2").hide();
$("#results1").show();
$("#results1").html(
'<img src="image/catalog/print_on_canvas/load.gif"> <span>Ожидайте Ваш заказ обрабатывается...</span>',
);
},
success: function (data) {
if (true) {
$.ajax({
url: "index.php?route=pageorder/pageorder/sendMailclients",
type: "POST",
dataType: "json",
cache: false,
contentType: false,
processData: false,
data: formData,
success: function (data) {
if (true) {
$("#results1").hide();
$("#results").show();
$("#results").html(
'<img src="image/catalog/print_on_canvas/yes.gif"> <span>Спасибо! Ваша заказ принят в обработку. Ожидайте обратную связь на указаную почту.</span>',
);
$('.reset').val('');
console.log("письмо клиенту отправлено");
// console.log("сanvas_cover2: ", сanvas_cover2, ", config_canvas_cover_two: ", config_canvas_cover_two);
// console.log("сanvas_cover: ", сanvas_cover);
}
}
});
console.log("письмо админу отправлено");
} else if (false) {
$("#results1").hide();
$("#results").show();
$("#results").html(
'<img src="image/catalog/print_on_canvas/no.gif"> <span style="color: red;">Произошла ошибка, пожалуйста, сообщите об этом администратору сайта!</span>',
);
} else {
$("#results1").hide();
$("#results").show();
$("#itoghp").show();
$("#results").html(
'<img src="image/catalog/print_on_canvas/no.gif"> <span style="color: green;">Неверный номер телефона! <a onclick="setFocus();">Исправить</a></span>',
);
}
},
});
return false;
}
Код PHP:
public function sendMail() {
$json = array();
if ($this->request->server['REQUEST_METHOD'] == 'POST') {
if ((utf8_strlen($this->request->post['phone']) < 6) || (utf8_strlen($this->request->post['phone']) > 2500)) {
$json['error'] = 'Заполните пожалуйста номер телефона';
}
if ((utf8_strlen($this->request->post['name']) < 3) || (utf8_strlen($this->request->post['name']) > 2500)) {
$json['error'] = 'Пожалуйста, укажите Ваше имя';
}
$myFaile = '';
$file_name = '';
//сохраняем наш файл на сервер в папку /upload/
//если не хотите хранить файл на сервере, не забывайте его потом удалить после отправки
if (!empty($_FILES['file_v']['tmp_name'])) {
$path = $_SERVER['DOCUMENT_ROOT']."/upload/".$_FILES['file_v']['name'];
if (copy($_FILES['file_v']['tmp_name'], $path)){
$myFaile = $path;
$file_name = $_FILES['file_v']['name'];
$file_url = "upload/".$_FILES['file_v']['name'];
}
}
$text = '';
if (!isset($json['error'])) {
//send form
$html = '<h3>Новый заказ с сайта Plotermedia</h3>';
$html .= '<p><b>Имя:</b> '.$this->request->post['name'].'</p>';
$html .= '<p><b>Телефон:</b> '.$this->request->post['phone'].'</p>';
$html .= '<p><b>E-mail:</b> '.$this->request->post['email'].'</p>';
if ($this->request->post['delivery_one2']){
$html .= '<p><b>Доставка:</b> '.$this->request->post['delivery_one2'].'</p>';
}
else {
$html .= '<p><b>Доставка:</b> '.$this->request->post['addrdost'].'</p>';
}
if ($this->request->post['message']) {
$html .= '<p><b>Комментарий:</b> '.$this->request->post['message'].'</p>';}
$html .= '<p><b>Параметры печати на холсте:</b></p><table border="2" style="width: 550px;" cellpadding="0" cellspacing="0"><tbody>';
$html .= '<tr><td style="padding: 10px 0px 10px 5px;"><strong>Ориентация холста</strong></td><td style="text-align: center;">'.$this->request->post['orientation'].'</td></tr>';
$html .= '<tr><td style="padding: 10px 0px 10px 5px;"><strong>Размер холста, см</strong></td><td style="text-align: center;">'.$this->request->post['size_holst'].'</td></tr>';
$html .= '<tr><td style="padding: 10px 0px 10px 5px;"><strong>Вид натяжки</strong></td><td style="text-align: center;">'.$this->request->post['type_scretch'].'</td></tr>';
$html .= '<tr><td style="padding: 10px 0px 10px 5px;"><strong>Подвесная система</strong></td><td style="text-align: center;">'.$this->request->post['suspension_system'].'</td></tr>';
$html .= '<tr><td style="padding: 10px 0px 10px 5px;"><strong>Покрытие холста</strong></td><td style="text-align: center;">'.$this->request->post['canvas_cover'].'</td></tr>';
if ($this->request->post['baget_src'] != $this->request->post['text_no']) {
$html .= '<tr><td rowspan="2" style="padding: 10px 0px 10px 5px;"><strong>Оформление в багет</strong></td><td style="text-align: center;">'.$this->request->post['making_a_baguette'].'</td></tr>';
$html .= '<tr><td style="text-align: center;"><img src="https://plotermedia.md/image/'.$this->request->post['baget_src'].'" style="width: 100px; height: auto;"></td></tr>';
} else {
$html .= '<tr><td style="padding: 10px 0px 10px 5px;"><strong>Оформление в багет</strong></td><td style="text-align: center;">'.$this->request->post['making_a_baguette'].'</td></tr>';
}
$html .= '<tr><td style="padding: 10px 0px 10px 5px;"><strong>Дизайнерская обработка</strong></td><td style="text-align: center;">'.$this->request->post['design_processing'].'</td></tr>';
if ($this->request->post['design_processing2'] != $this->request->post['text_no']) {
$html .= '<tr><td style="padding: 10px 0px 10px 5px;"><strong>Количество лиц</strong></td><td style="text-align: center;">'.$this->request->post['kol_lic'].'</td></tr>';
}
$html .= '<tr><td style="padding: 10px 0px 10px 5px;"><strong>Упаковка</strong></td><td style="text-align: center;">'.$this->request->post['packaging'].'</td></tr>';
if ($this->request->post['canvas_cover2'] == $this->request->post['config_canvas_cover_two']){
$html .= '<tr><td style="padding: 10px 0px 10px 5px;"><strong>Срок изготовления заказа</strong></td><td style="text-align: center;">2 дня</td></tr>';
} else {
$html .= '<tr><td style="padding: 10px 0px 10px 5px;"><strong>Срок изготовления заказа</strong></td><td style="text-align: center;">1 день</td></tr>';
}
if ($this->request->post['dostavkafz'] == $this->request->post['delivery_one']) {
$html .= '<tr><td style="padding: 10px 0px 10px 5px;"><strong>Итоговая стоимость</strong></td><td style="text-align: center;">'.$this->request->post['price_itog'].' лей.</td></tr></tbody></table>';
}
if ($this->request->post['delivery_two']) {
$html .= '<tr><td style="padding: 10px 0px 10px 5px;"><strong>Стоимость холста</strong></td><td style="text-align: center;">'.$this->request->post['price_holst'].' лей.</td></tr>';
$html .= '<tr><td style="padding: 10px 0px 10px 5px;"><strong>Стоимость доставки</strong></td><td style="text-align: center;">'.$this->request->post['delivery_two'].' лей.</td></tr>';
$html .= '<tr><td style="padding: 10px 0px 10px 5px;"><strong>Итоговая стоимость</strong></td><td style="text-align: center;">'.$this->request->post['price_itog'].' лей.</td></tr></tbody></table>';
}
if ($this->request->post['delivery_three']) {
$html .= '<tr><td style="padding: 10px 0px 10px 5px;"><strong>Стоимость холста</strong></td><td style="text-align: center;">'.$this->request->post['price_holst'].' лей.</td></tr>';
$html .= '<tr><td style="padding: 10px 0px 10px 5px;"><strong>Стоимость доставки</strong></td><td style="text-align: center;">'.$this->request->post['delivery_three'].' лей.</td></tr>';
$html .= '<tr><td style="padding: 10px 0px 10px 5px;"><strong>Итоговая стоимость</strong></td><td style="text-align: center;">'.$this->request->post['price_itog'].' лей.</td></tr></tbody></table>';
}
$mail = new Mail();
$mail->protocol = $this->config->get('config_mail_protocol');
$mail->parameter = $this->config->get('config_mail_parameter');
$mail->smtp_hostname = $this->config->get('config_mail_smtp_hostname');
$mail->smtp_username = $this->config->get('config_mail_smtp_username');
$mail->smtp_password = html_entity_decode($this->config->get('config_mail_smtp_password'), ENT_QUOTES, 'UTF-8');
$mail->smtp_port = $this->config->get('config_mail_smtp_port');
$mail->smtp_timeout = $this->config->get('config_mail_smtp_timeout');
$mail->setTo($this->config->get('config_mail_alert_email'));
$mail->setFrom('[email protected]');
$mail->setSender(html_entity_decode($this->config->get('config_name'), ENT_QUOTES, 'UTF-8'));
$mail->setSubject(html_entity_decode('Новый заказ: Печать на холсте', ENT_QUOTES, 'UTF-8'));
$mail->setHtml($html);
$mail->AddAttachment($file_url);
$mail->setText(html_entity_decode($text, ENT_QUOTES, 'UTF-8'));
$mail->send();
$json['success'] = true;
}
}
$this->response->setOutput(json_encode($json));
}
public function sendMailclients() {
$json = array();
if ($this->request->server['REQUEST_METHOD'] == 'POST') {
if ((utf8_strlen($this->request->post['phone']) < 6) || (utf8_strlen($this->request->post['phone']) > 2500)) {
$json['error'] = 'Заполните пожалуйста номер телефона';
}
if ((utf8_strlen($this->request->post['name']) < 3) || (utf8_strlen($this->request->post['name']) > 2500)) {
$json['error'] = 'Пожалуйста, укажите Ваше имя';
}
$myFaile = '';
$file_name = '';
//сохраняем наш файл на сервер в папку /upload/
//если не хотите хранить файл на сервере, не забывайте его потом удалить после отправки
if (!empty($_FILES['file_v']['tmp_name'])) {
$file_url = "/upload/".$_FILES['file_v']['name'];
}
$text = '';
if (!isset($json['error'])) {
//send form
$html = $this->request->post['text_hello_mail'].', '.$this->request->post['name'].'!</h3><p>'.$this->request->post['text_text_mail'].'</p>';
$html .= '<p>'.$this->request->post['text_var_mail'].'</p>';
$html .= '<p><b>'.$this->request->post['text_telephone'].':</b> '.$this->request->post['phone'].'</p>';
$html .= '<p><b>E-mail:</b> '.$this->request->post['email'].'</p>';
if ($this->request->post['delivery_one']){
$html .= '<p><b>'.$this->request->post['text_delivery'].':</b> '.$this->request->post['delivery_one'].'</p>';
}
else {
$html .= '<p><b>'.$this->request->post['text_delivery'].':</b> '.$this->request->post['addrdost'].'</p>';
}
if ($this->request->post['message']) {
$html .= '<p><b>'.$this->request->post['text_comment'].':</b> '.$this->request->post['message'].'</p>';}
$html .= '<p><strong>'.$this->request->post['text_canvas_printing_options_mail'].':</strong></p><table border="2" style="width: 550px;" cellpadding="0" cellspacing="0"><tbody>';
$html .= '<tr><td style="padding: 10px 0px 10px 5px;"><strong>'.$this->request->post['text_canvas_orientation'].'</strong></td><td style="text-align: center;">'.$this->request->post['orientation2'].'</td></tr>';
$html .= '<tr><td style="padding: 10px 0px 10px 5px;"><strong>'.$this->request->post['text_canvas_size'].'</strong></td><td style="text-align: center;">'.$this->request->post['size_holst'].'</td></tr>';
$html .= '<tr><td style="padding: 10px 0px 10px 5px;"><strong>'.$this->request->post['text_type_of_stretch'].'</strong></td><td style="text-align: center;">'.$this->request->post['type_scretch2'].'</td></tr>';
$html .= '<tr><td style="padding: 10px 0px 10px 5px;"><strong>'.$this->request->post['text_suspension_system'].'</strong></td><td style="text-align: center;">'.$this->request->post['suspension_system2'].'</td></tr>';
$html .= '<tr><td style="padding: 10px 0px 10px 5px;"><strong>'.$this->request->post['text_сanvas_cover'].'</strong></td><td style="text-align: center;">'.$this->request->post['canvas_cover2'].'</td></tr>';
if ($this->request->post['baget_src'] != $this->request->post['text_no']) {
$html .= '<tr><td rowspan="2" style="padding: 10px 0px 10px 5px;"><strong>'.$this->request->post['text_making_a_baguette'].'</strong></td><td style="text-align: center;">'.$this->request->post['making_a_baguette2'].'</td></tr>';
$html .= '<tr><td style="text-align: center;"><img src="https://plotermedia.md/image/'.$this->request->post['baget_src'].'" style="width: 100px; height: auto;"></td></tr>';
} else {
$html .= '<tr><td style="padding: 10px 0px 10px 5px;"><strong>'.$this->request->post['text_making_a_baguette'].'</strong></td><td style="text-align: center;">'.$this->request->post['making_a_baguette2'].'</td></tr>';
}
$html .= '<tr><td style="padding: 10px 0px 10px 5px;"><strong>'.$this->request->post['text_design_processing'].'</strong></td><td style="text-align: center;">'.$this->request->post['design_processing2'].'</td></tr>';
if ($this->request->post['design_processing2'] != $this->request->post['text_no']) {
$html .= '<tr><td style="padding: 10px 0px 10px 5px;"><strong>'.$this->request->post['text_number_of_persons'].'</strong></td><td style="text-align: center;">'.$this->request->post['kol_lic'].'</td></tr>';
}
$html .= '<tr><td style="padding: 10px 0px 10px 5px;"><strong>'.$this->request->post['text_packaging'].'</strong></td><td style="text-align: center;">'.$this->request->post['packaging2'].'</td></tr>';
$html .= '<tr><td style="padding: 10px 0px 10px 5px;"><strong>'.$this->request->post['your_image'].'</strong></td><td style="display: flex; justify-content: center; padding: 10px 10px;"><img src="https://plotermedia.md/'.$file_url.'" style="width: 150px; height: auto;"></td></tr>';
if ($this->request->post['canvas_cover2'] == $this->request->post['config_canvas_cover_two']){
$html .= '<tr><td style="padding: 10px 0px 10px 5px;"><strong>'.$this->request->post['text_order_production_time'].'</strong></td><td style="text-align: center;">2 '.$this->request->post['text_order_production_days'].'</td></tr>';
} else {
$html .= '<tr><td style="padding: 10px 0px 10px 5px;"><strong>'.$this->request->post['text_order_production_time'].'</strong></td><td style="text-align: center;">1 '.$this->request->post['text_order_production_day'].'</td></tr>';
}
if ($this->request->post['dostavkafz'] == $this->request->post['delivery_one']) {
$html .= '<tr><td style="padding: 10px 0px 10px 5px;"><strong>'.$this->request->post['text_total_cost_of_the_order'].'</strong></td><td style="text-align: center;">'.$this->request->post['price_itog'].' '.$this->request->post['text_currenncy_pageorder'].'</td></tr></tbody></table>';
}
if ($this->request->post['delivery_two']) {
$html .= '<tr><td style="padding: 10px 0px 10px 5px;"><strong>'.$this->request->post['text_the_cost_of_the_canvas'].'</strong></td><td style="text-align: center;">'.$this->request->post['price_holst'].' '.$this->request->post['text_currenncy_pageorder'].'</td></tr>';
$html .= '<tr><td style="padding: 10px 0px 10px 5px;"><strong>'.$this->request->post['text_the_cost_of_the_delivery'].'</strong></td><td style="text-align: center;">'.$this->request->post['delivery_two'].' '.$this->request->post['text_currenncy_pageorder'].'</td></tr>';
$html .= '<tr><td style="padding: 10px 0px 10px 5px;"><strong>'.$this->request->post['text_total_cost_of_the_order'].'</strong></td><td style="text-align: center;">'.$this->request->post['price_itog'].' '.$this->request->post['text_currenncy_pageorder'].'</td></tr></tbody></table>';
}
if ($this->request->post['delivery_three']) {
$html .= '<tr><td style="padding: 10px 0px 10px 5px;"><strong>'.$this->request->post['text_the_cost_of_the_canvas'].'</strong></td><td style="text-align: center;">'.$this->request->post['price_holst'].' '.$this->request->post['text_currenncy_pageorder'].'</td></tr>';
$html .= '<tr><td style="padding: 10px 0px 10px 5px;"><strong>'.$this->request->post['text_the_cost_of_the_delivery'].'</strong></td><td style="text-align: center;">'.$this->request->post['delivery_three'].' '.$this->request->post['text_currenncy_pageorder'].'</td></tr>';
$html .= '<tr><td style="padding: 10px 0px 10px 5px;"><strong>'.$this->request->post['text_total_cost_of_the_order'].'</strong></td><td style="text-align: center;">'.$this->request->post['price_itog'].' '.$this->request->post['text_currenncy_pageorder'].'</td></tr></tbody></table>';
}
$mail = new Mail();
$mail->protocol = $this->config->get('config_mail_protocol');
$mail->parameter = $this->config->get('config_mail_parameter');
$mail->smtp_hostname = $this->config->get('config_mail_smtp_hostname');
$mail->smtp_username = $this->config->get('config_mail_smtp_username');
$mail->smtp_password = html_entity_decode($this->config->get('config_mail_smtp_password'), ENT_QUOTES, 'UTF-8');
$mail->smtp_port = $this->config->get('config_mail_smtp_port');
$mail->smtp_timeout = $this->config->get('config_mail_smtp_timeout');
$mail->setTo($this->request->post['email']);
$mail->setFrom('[email protected]');
$mail->setSender(html_entity_decode($this->config->get('config_name'), ENT_QUOTES, 'UTF-8'));
$mail->setSubject(html_entity_decode('Ваша заявка принята', ENT_QUOTES, 'UTF-8'));
$mail->setHtml($html);
$mail->AddAttachment($file_url, "inline");
$mail->setText(html_entity_decode($text, ENT_QUOTES, 'UTF-8'));
$mail->send();
$json['success'] = true;
}
}
$this->response->setOutput(json_encode($json));
}