Files
xk-api-yii/common/core/sms/PrescriptionPassMessage.php
2024-09-19 11:32:39 +08:00

39 lines
1.0 KiB
PHP

<?php
namespace common\core\sms;
use Overtrue\EasySms\Contracts\GatewayInterface;
use Overtrue\EasySms\Message;
class PrescriptionPassMessage extends Message
{
protected $prescription_no;
protected $smsConfig;
public function __construct($prescription_no, $smsConfig)
{
$this->prescription_no = $prescription_no;
$this->smsConfig = $smsConfig;
}
// 定义直接使用内容发送平台的内容
public function getContent(GatewayInterface $gateway = null)
{
return sprintf('您的编号为 %s 的处方已通过审核,详情前往萧康云医小程序查看!', $this->prescription_no);
}
// 定义使用模板发送方式平台所需要的模板 ID
public function getTemplate(GatewayInterface $gateway = null)
{
return $this->smsConfig['template_id'];
}
// 模板参数
public function getData(GatewayInterface $gateway = null)
{
return [
$this->smsConfig['template_variable'] => $this->prescription_no
];
}
}