Before sending a letter, attach a pdf file of the same letter. question. how to get the html code of the letter before sending it so that everything is already substituted there?
Answer 1, authority 100%
Event OnBeforeEventSend
, but you have to substitute the values first
Example:
AddEventHandler ('main', 'OnBeforeEventSend', Array ("MyForm", "my_OnBeforeEventSend"));
class MyForm
{
function my_OnBeforeEventSend ($ arFields, $ arTemplate)
{
// get the message
$ mess = $ arTemplate ["MESSAGE"];
foreach ($ arFields as $ keyField = & gt; $ arField)
$ mess = str_replace ('#'. $ keyField. '#', $ arField, $ mess); // substitute values into the template
}
}