Creating BMailChannel
This commit is contained in:
parent
acf10e92b4
commit
a59eca7dc4
|
@ -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');
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue