M
M
Maria Popova2021-06-10 17:36:02
1C-Bitrix
Maria Popova, 2021-06-10 17:36:02

How to attach a file in a Bitrix email?

$arFile=CFile::MakeFileArray($_SERVER['DOCUMENT_ROOT'].'/upload/declaration-pdf');
$fid = CFile::SaveFile($arFile, "");
CEvent::Send("APPLICATION_SUBMISSION_2", "s1", $arEventFields,array(CFile::GetPath($fid)));
CEvent::Send("APPLICATION_SUBMISSION_2", "s1", $arEventFields,array(($fid));


I'm trying to attach a file this way in the CEvent::Send method, but the email arrives without a file
, what's wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Gritsuk, 2021-06-11
@winer

I'm trying to attach a file this way in the CEvent::Send method, but the email arrives without a file
, what's wrong?

The error is that you are not transferring the file correctly. The file is passed as the 6th parameter to the function, and you have the 4th
Look carefully at the documentation

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question