Documentation

Methods for directly sending the provider

\Bitrix\MessageService\Providers\Sender::sendMessage

\$messageFields = [
	'TYPE' => \Bitrix\MessageService\Providers\Edna\Constants\ChannelType::WHATSAPP,
	'SENDER_ID' => \Bitrix\MessageService\Sender\Sms\Ednaru::ID,
	'AUTHOR_ID' => '1',
	'MESSAGE_FROM' => $from,
	'MESSAGE_TO' => $phoneNumber,
	'MESSAGE_HEADERS' => [
		'template' => [
			'header' => ['text' => $header],
			'text' => $message,
		],
	],
	'MESSAGE_BODY' => $message,
];
$senderId = \Bitrix\MessageService\Sender\Sms\Ednaru::ID;
$sender = \Bitrix\MessageService\Sender\SmsManager::getSenderById($senderId);
$sender->sendMessage($messageFields);
© «Bitrix24», 2001-2024
Up