Skip to content

Latest commit

 

History

History
34 lines (33 loc) · 784 Bytes

SMS.md

File metadata and controls

34 lines (33 loc) · 784 Bytes

短信 SMS

$config = [
    'timeout' => 5.0,
    'default' => [
        'strategy' => \Overtrue\EasySms\Strategies\OrderStrategy::class,
        'gateways' => [
            'yunpian', 'aliyun',
        ],
    ],
    'gateways' => [
        'errorlog' => [
            'file' => '/tmp/easy-sms.log',
        ],
        'yunpian' => [
            'api_key' => '824f0ff2f71cab52936axxxxxxxxxx',
        ],
        'aliyun' => [
            'access_key_id' => '',
            'access_key_secret' => '',
            'sign_name' => '',
        ],
    ],
];
SmsHelper::instance($config)->send('13500000001', [
    'content' => '您的验证码为: 6379',
    'template' => 'SMS_001',
    'data' => [
        'code' => 6379
    ]
]);
文档 https://github.com/overtrue/easy-sms