Skip to content

增加动态配置短信模板 #168

@nonrk

Description

@nonrk

在SmsManger类下增加
//存储动态配置模板
protected $templates =[];
//配置方法
public function options($arg){ $this->templates=$arg; }
//修改
protected function generateTemplates($type)
{

if(count($this->templates)!=0){ //判断是否使用动态配置模板
$templates =$this->templates;
}
else
{
$templates = config('laravel-sms.templates');
}

//...
}
在发送前使用,这样可选择每次发送的短信模板
$options=[
‘Aliyun’=>'SMS_xxxxxx',
];
SmsManger::options($options);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions