A
A
anriko2020-08-06 16:35:38
1C-Bitrix
anriko, 2020-08-06 16:35:38

Why does the assignment of a constant to the field that will be displayed in the email template not work in the form.result.new component?

this is in init
$get_domain = explode('.', $_SERVER["HTTP_HOST"]);
define("GET_DOMAIN", $get_domain[1] );
it's in form.result.new file components
$arResult["arAnswers"]["TEST"][0]["VALUE"]= "TEST!!!";
if ( GET_DOMAIN ) {
$arResult["arAnswers"]["DOMAIN"][0]["VALUE"] = GET_DOMAIN;}

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey, 2020-08-07
@AlexeyCaTHaR

It's unclear.
Is it possible that the letter is sent via CEvent::Send and conditionally in the background (not on this hit\crown), and the change is made in the component template after it has been sent to the event table?

E
Edward, 2020-08-09
@Drayde

define("GET_DOMAIN", $get_domain[1] );

Because you are assigning a non-scalar value. Use global instead of constant.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question