You've already forked laravel-mail
Creating BMailChannel
This commit is contained in:
@@ -60,7 +60,7 @@ $template = (new BMailTemplate("** template_id **"))
|
||||
]
|
||||
])
|
||||
->addRecipient("edward@gmail.com")
|
||||
->parameters(["key1" => "value1", "key2" => "value2"])
|
||||
->parameters(["key" => "value", "key" => "value"])
|
||||
->addParameter("key", "value");
|
||||
```
|
||||
|
||||
|
||||
@@ -20,6 +20,11 @@ class BMailApi
|
||||
$this->api_key = $api_key;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $template
|
||||
* @return \Psr\Http\Message\StreamInterface
|
||||
* @throws BMailException
|
||||
*/
|
||||
public function send($template)
|
||||
{
|
||||
$url = config('bmail.api_url');
|
||||
|
||||
17
src/Broadcasting/BMailChannel.php
Normal file
17
src/Broadcasting/BMailChannel.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace BMail;
|
||||
|
||||
use Illuminate\Notifications\Notification;
|
||||
|
||||
|
||||
class BMailChannel
|
||||
{
|
||||
public function send($notifiable, Notification $notification)
|
||||
{
|
||||
$template = $notification->toTemplate($notifiable);
|
||||
|
||||
return (new BMailApi(config("bmail.api_key")))->send($template);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user