Fix extra notification

This commit is contained in:
James Cole
2022-09-24 12:17:55 +02:00
parent 45d7042405
commit 600fa388c1
4 changed files with 41 additions and 7 deletions

View File

@@ -24,6 +24,7 @@ namespace FireflyIII\Notifications\User;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Messages\SlackMessage;
use Illuminate\Notifications\Notification;
class NewAccessToken extends Notification
@@ -47,7 +48,7 @@ class NewAccessToken extends Notification
*/
public function via($notifiable)
{
return ['mail'];
return ['mail', 'slack'];
}
/**
@@ -62,6 +63,16 @@ class NewAccessToken extends Notification
->markdown('emails.token-created')
->subject((string) trans('email.access_token_created_subject'));
}
/**
* Get the Slack representation of the notification.
*
* @param mixed $notifiable
* @return SlackMessage
*/
public function toSlack($notifiable)
{
return (new SlackMessage)->content((string) trans('email.access_token_created_body'));
}
/**
* Get the array representation of the notification.