Answer the question
In order to leave comments, you need to log in
How to fix cracks in outgoing emails?
AddEventHandler("iblock", "OnAfterIBlockElementAdd", Array("OnAfterArticleAdd", "OnAfterIBlockElementAddHandlerLast"));
class OnAfterArticleAdd {
function OnAfterIBlockElementAddHandlerLast(&$arFields) {
if ($arFields["IBLOCK_ID"] == 26 && $arFields["RESULT"]>0) {
$message .= 'Свойство 1: '.$arFields['PROPERTY_VALUES']['FIO'];
mail('[email protected]', 'Добавлен отзыв на сайт', $message, $headers);
}
}
}
Свойство 1: Антон
Answer the question
In order to leave comments, you need to log in
I think the problem is here:
fs.writeFile(fullPath, base64Image, { encoding: 'base64' }, err => {
if (err) return res.status(500).send(`Ошибка сохранения файла: ${err}`)
else return
});
const promise = new Promise(resolve, reject)=>{
fs.writeFile(fullPath, base64Image, { encoding: 'base64' }, err => {
if (!err) return resolve(true);
res.status(500).send(`Ошибка сохранения файла: ${err}`)
return reject(false);
});
});
const isWrite = await promise;
if(!isWrite) return;
php.net/manual/ru/function.mb-convert-encoding.php
something like this, play around with the second parameter of the function, perhaps a different encoding will be needed there.
So to speak, "temporarily rewound with tape":
Well, or just make sure that the array "comes" not in 1251, but immediately in utf8
There is already a built-in functionality for working with mail events. Use it.
Link
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question