okay
This commit is contained in:
parent
7aacad4e09
commit
92c28d9d67
|
|
@ -26,7 +26,8 @@ class ReportMailer extends Mailable
|
|||
public function __construct(ProjectMailing $mailing)
|
||||
{
|
||||
$this->mailing = $mailing;
|
||||
$this->to($mailing->recipients()->pluck('email')->toArray());
|
||||
// logger($mailing->recipients()->pluck('email')->toArray());
|
||||
// $this->to(['martin@sobit.nl', ...($mailing->recipients()->pluck('email')->toArray())]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -21,7 +21,11 @@ class ProjectMailing extends Model
|
|||
protected static function booted()
|
||||
{
|
||||
static::created(function (ProjectMailing $projectMailing) {
|
||||
Mail::to($projectMailing->recipients()->pluck('email')->toArray())
|
||||
$toAddresses = $projectMailing->recipients()->pluck('email')->toArray();
|
||||
logger('created');
|
||||
logger($projectMailing);
|
||||
|
||||
Mail::to($toAddresses)
|
||||
->send(new \App\Mail\ReportMailer($projectMailing));
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue