3namespace Bitrix\MessageService\Providers\Edna\WhatsApp;
5use Bitrix\Main\ArgumentException;
6use Bitrix\Main\Web\Json;
7use Bitrix\MessageService\Providers\Constants\InternalOption;
8use Bitrix\MessageService\Providers\Edna\EdnaRu;
30 $templatesResult = $this->utils->getMessageTemplates();
31 if (!$templatesResult->isSuccess())
36 $templates = $templatesResult->getData();
37 if (!is_array($templates))
46 'ID' => Json::encode(
$template[
'content']),
49 'PREVIEW' =>
$template[
'content'][
'text'] ??
'',
52 if (!empty(
$template[
'content'][
'header'][
'text']))
56 if (!empty(
$template[
'content'][
'footer'][
'text']))
60 if (!empty(
$template[
'content'][
'keyboard'][
'rows']))
66 $tmp[
'PLACEHOLDERS'] = [];
68 if (!empty(
$template[
'placeholders'][
'text']))
70 $tmp[
'PLACEHOLDERS'][
'PREVIEW'] =
$template[
'placeholders'][
'text'];
72 if (!empty(
$template[
'placeholders'][
'header']))
74 $tmp[
'PLACEHOLDERS'][
'HEADER'] =
$template[
'placeholders'][
'header'];
76 if (!empty(
$template[
'placeholders'][
'footer']))
78 $tmp[
'PLACEHOLDERS'][
'FOOTER'] =
$template[
'placeholders'][
'footer'];
91 $messageTemplateDecoded = Json::decode($templateData);
92 $messageTemplateDecoded =
93 $this->emoji->convertEmojiInTemplate($messageTemplateDecoded, InternalOption::EMOJI_ENCODE);
100 return $messageTemplateDecoded;
__construct(string $providerId, EdnaRu $utils, EmojiConverter $emoji)
getTemplatesList(array $context=null)
prepareTemplate($templateData)
if(!is_array($prop["VALUES"])) $tmp
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)