diff --git a/README.md b/README.md index 149f8c3..0ac66e8 100644 --- a/README.md +++ b/README.md @@ -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"); ``` diff --git a/src/BMailApi.php b/src/BMailApi.php index 58547d0..1a681d4 100644 --- a/src/BMailApi.php +++ b/src/BMailApi.php @@ -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'); diff --git a/src/Broadcasting/BMailChannel.php b/src/Broadcasting/BMailChannel.php new file mode 100644 index 0000000..a2dfb09 --- /dev/null +++ b/src/Broadcasting/BMailChannel.php @@ -0,0 +1,17 @@ +toTemplate($notifiable); + + return (new BMailApi(config("bmail.api_key")))->send($template); + } +}