laravel - 使用 nexmo 在 laravel 中将发件人名称从验证更改为我的公司名称
问题描述
我尝试将 nexom "verify" 提供的消息标题更改为我的公司名称。我升级了我的 nexmo 账户并把钱存入其中。我尝试使用但不工作。
这是我的通知
<?php
namespace App\Notifications;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Messages\NexmoMessage;
//use App\admin\Course;
class ConfirmedCourse extends Notification
{
use Queueable;
protected $course;
/**
* Create a new notification instance.
*
* @return void
*/
public function __construct($course)
{
$this->course = $course;
}
/**
* Get the notification's delivery channels.
*
* @param mixed $notifiable
* @return array
*/
public function via($notifiable)
{
return ['nexmo'];
}
public function toNexmo($notifiable)
{
try {
$message = new NexmoMessage();
$message->from('basma center')->content($this->course)
->unicode();
return $message;
}catch (\Exception $e) {
$e->getMessage();
}
}
}
请问我该如何解决这个问题??预先感谢
解决方案
查看来自 Laravel 的代码,我相信您所做的是正确的,因为看起来他们将您的“来自”设置传递回了通知堆栈。我唯一能想到的可能是国家/地区限制,因为不同的国家/地区对发件人数据有不同的 SMS 要求。
您可能需要查看国家/地区特定功能和建议列表,以查看运营商是否忽略了这一点。
还要记住,Laravel 通知是纯 SMS 消息,它们不是我们的验证产品。您可以使用原始 SMS 设置为“发件人”选项的内容受到更多限制(请参阅上面的国家/地区限制)。
推荐阅读
- python - django过滤器选择,模板上的顺序选择,按过滤器中写入的顺序
- javascript - 向 Azure Blob 存储发出 GET 请求时授权失败 [REST API][Azure Blob 存储]
- java - 在检查 available() 后调用 read() 时,stdin 没有在 Windows 上回显(可中断的 readline 实现)
- c++ - 设置具有多列的 QComboBox 文本
- python - 列表理解中的 Numpy 数组划分导致大量 RAM 膨胀?
- python-3.x - 嵌套循环不打印正确的行号python
- c# - 在存储库模式中使用左连接和自动映射器
- powershell - ConvertToHTML 转换错误
- mysql - gcloud mysql 5.7是否支持AES-128-CFB8块加密模式?
- azure-data-explorer - Kusto:在固定大小的固定 bin 中汇总具有实数值的不同行