This commit is contained in:
Martin Folkerts 2024-01-31 21:21:47 +01:00
parent 4ca6a3ebd8
commit 7b39edd094
2 changed files with 3 additions and 8 deletions

View file

@ -47,12 +47,6 @@ public function content(): Content
htmlString: $this->mailing->message, htmlString: $this->mailing->message,
); );
} }
public function build(): self
{
$this->to($this->mailing->recipients()->pluck('email')->toArray());
return $this;
}
/** /**
* Get the attachments for the message. * Get the attachments for the message.

View file

@ -20,8 +20,9 @@ class ProjectMailing extends Model
protected static function booted() protected static function booted()
{ {
static::created(function ($projectMailing) { static::created(function (ProjectMailing $projectMailing) {
Mail::send(new \App\Mail\ReportMailer($projectMailing)); Mail::to($projectMailing->recipients()->pluck('email')->toArray())
->send(new \App\Mail\ReportMailer($projectMailing));
}); });
} }