remove Mail use from Notifications classes
This commit is contained in:
1 parent
f13e96c7c7
commit
4c52fa5043
10 files changed
+91
-111
No files matched your search
@@ -25,10 +25,6 @@ class EventDeleted extends Notification implements ShouldBroadcast
|
||||
$channels[] = 'broadcast';
|
||||
}
|
||||
|
||||
if ($notifiable->email_notifications) {
|
||||
$channels[] = 'mail';
|
||||
}
|
||||
|
||||
return $channels;
|
||||
}
|
||||
|
||||
@@ -44,15 +40,4 @@ class EventDeleted extends Notification implements ShouldBroadcast
|
||||
{
|
||||
return new BroadcastMessage($this->toDatabase($notifiable));
|
||||
}
|
||||
|
||||
public function toMail($notifiable): void
|
||||
{
|
||||
Mail::to($notifiable->email)->send(new EventParticipationCancelledMail([
|
||||
'name' => $notifiable->name,
|
||||
'lastname' => $notifiable->lastname,
|
||||
'eventName' => $this->event->name,
|
||||
'start' => $this->event->start,
|
||||
'end' => $this->event->end,
|
||||
]));
|
||||
}
|
||||
}
|
||||
@@ -33,10 +33,6 @@ class TaskDateUpdated extends Notification implements ShouldBroadcast
|
||||
$channels[] = 'broadcast';
|
||||
}
|
||||
|
||||
if ($notifiable->email_notifications) {
|
||||
$channels[] = 'mail';
|
||||
}
|
||||
|
||||
return $channels;
|
||||
}
|
||||
|
||||
@@ -57,18 +53,4 @@ class TaskDateUpdated extends Notification implements ShouldBroadcast
|
||||
{
|
||||
return new BroadcastMessage($this->toDatabase($notifiable));
|
||||
}
|
||||
|
||||
public function toMail($notifiable): void
|
||||
{
|
||||
Mail::to($notifiable->email)->send(new TaskDateUpdateMail([
|
||||
'name' => $notifiable->name,
|
||||
'lastname' => $notifiable->lastname,
|
||||
'taskName' => $this->task->name,
|
||||
'oldStart' => $this->oldStart,
|
||||
'oldEnd' => $this->oldEnd,
|
||||
'newStart' => $this->newStart,
|
||||
'newEnd' => $this->newEnd,
|
||||
'eventName' => $this->event->name,
|
||||
]));
|
||||
}
|
||||
}
|
||||
@@ -29,10 +29,6 @@ class TaskDeleted extends Notification implements ShouldBroadcast
|
||||
$channels[] = 'broadcast';
|
||||
}
|
||||
|
||||
if ($notifiable->email_notifications) {
|
||||
$channels[] = 'mail';
|
||||
}
|
||||
|
||||
return $channels;
|
||||
}
|
||||
|
||||
@@ -49,16 +45,4 @@ class TaskDeleted extends Notification implements ShouldBroadcast
|
||||
{
|
||||
return new BroadcastMessage($this->toDatabase($notifiable));
|
||||
}
|
||||
|
||||
public function toMail($notifiable): void
|
||||
{
|
||||
Mail::to($notifiable->email)->send(new TaskParticipationCancelledMail([
|
||||
'name' => $notifiable->name,
|
||||
'lastname' => $notifiable->lastname,
|
||||
'taskName' => $this->task->name,
|
||||
'start' => $this->event->start,
|
||||
'end' => $this->task->end,
|
||||
'eventName' => $this->event->name,
|
||||
]));
|
||||
}
|
||||
}
|
||||
@@ -26,10 +26,6 @@ class UserRegistered extends Notification implements ShouldBroadcast
|
||||
$channels[] = 'broadcast';
|
||||
}
|
||||
|
||||
if ($notifiable->email_notifications) {
|
||||
$channels[] = 'mail';
|
||||
}
|
||||
|
||||
return $channels;
|
||||
}
|
||||
|
||||
@@ -45,16 +41,4 @@ class UserRegistered extends Notification implements ShouldBroadcast
|
||||
{
|
||||
return new BroadcastMessage($this->toDatabase($notifiable));
|
||||
}
|
||||
|
||||
public function toMail($notifiable): MailMessage
|
||||
{
|
||||
Mail::to($notifiable->email)->send(new RegisterMail([
|
||||
'adminName' => $notifiable->name,
|
||||
'adminLastname'=> $notifiable->lastname,
|
||||
'userName' => $this->user->name,
|
||||
'userLastname' => $this->user->lastname,
|
||||
]));
|
||||
|
||||
return (new MailMessage);
|
||||
}
|
||||
}
|
||||
@@ -29,10 +29,6 @@ class VolunteerAssignedToTask extends Notification implements ShouldBroadcast
|
||||
$channels[] = 'broadcast';
|
||||
}
|
||||
|
||||
if ($notifiable->email_notifications) {
|
||||
$channels[] = 'mail';
|
||||
}
|
||||
|
||||
return $channels;
|
||||
}
|
||||
|
||||
@@ -49,16 +45,4 @@ class VolunteerAssignedToTask extends Notification implements ShouldBroadcast
|
||||
{
|
||||
return new BroadcastMessage($this->toDatabase($notifiable));
|
||||
}
|
||||
|
||||
public function toMail($notifiable): void
|
||||
{
|
||||
Mail::to($notifiable->email)->send(new VolunteerAssignToTaskMail([
|
||||
'name' => $notifiable->name,
|
||||
'lastname' => $notifiable->lastname,
|
||||
'taskName' => $this->task->name,
|
||||
'start' => $this->task->start,
|
||||
'end' => $this->task->end,
|
||||
'eventName' => $this->event->name,
|
||||
]));
|
||||
}
|
||||
}
|
||||
@@ -24,10 +24,6 @@ class VolunteerRoleUpdated extends Notification implements ShouldBroadcast
|
||||
$channels[] = 'broadcast';
|
||||
}
|
||||
|
||||
if ($notifiable->email_notifications) {
|
||||
$channels[] = 'mail';
|
||||
}
|
||||
|
||||
return $channels;
|
||||
}
|
||||
|
||||
@@ -43,13 +39,4 @@ class VolunteerRoleUpdated extends Notification implements ShouldBroadcast
|
||||
{
|
||||
return new BroadcastMessage($this->toDatabase($notifiable));
|
||||
}
|
||||
|
||||
public function toMail($notifiable): void
|
||||
{
|
||||
Mail::to($notifiable->email)->send(new UpdateRoleMail([
|
||||
'name' => $notifiable->name,
|
||||
'lastname' => $notifiable->lastname,
|
||||
'role' => $this->role,
|
||||
]));
|
||||
}
|
||||
}
|
||||
@@ -29,10 +29,6 @@ class VolunteerUnassignedFromTask extends Notification implements ShouldBroadcas
|
||||
$channels[] = 'broadcast';
|
||||
}
|
||||
|
||||
if ($notifiable->email_notifications) {
|
||||
$channels[] = 'mail';
|
||||
}
|
||||
|
||||
return $channels;
|
||||
}
|
||||
|
||||
@@ -49,16 +45,4 @@ class VolunteerUnassignedFromTask extends Notification implements ShouldBroadcas
|
||||
{
|
||||
return new BroadcastMessage($this->toDatabase($notifiable));
|
||||
}
|
||||
|
||||
public function toMail($notifiable): void
|
||||
{
|
||||
Mail::to($notifiable->email)->send(new VolunteerUnassignToTaskMail([
|
||||
'name' => $notifiable->name,
|
||||
'lastname' => $notifiable->lastname,
|
||||
'taskName' => $this->task->name,
|
||||
'start' => $this->task->start,
|
||||
'end' => $this->task->end,
|
||||
'eventName' => $this->event->name,
|
||||
]));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user