Commit b7c2d1fc authored by Shakarim Sapa's avatar Shakarim Sapa

- Добавлена проверка на прочтенность письма

parent eff34992
<?php
namespace common\modules\triggers\components\conditions\conditions;
use common\components\UnisenderAPI;
use common\modules\triggers\components\conditions\vendor\ConditionBase;
use common\modules\triggers\components\conditions\vendor\ConditionInterface;
......@@ -19,7 +20,18 @@ class CheckEmailToOpening extends ConditionBase implements ConditionInterface {
return parent::init($conditionName);
}
/**
* @param $message
* @return bool
*/
public function check($message){
if (!is_null($message)) {
// Создаем объект унисендера
$sender=new UnisenderAPI();
// Делаем запрос на получение статуса сообщения
$sender->getMessageStatuses($message->message_id);
return $sender->isReaded();
}
return true;
}
}
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment