Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/Jobs/MailSendJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ class MailSendJob extends Notification implements ShouldQueue
* @var MailHistory
*/
protected $mailHistory;
protected $user;
protected $userId;
protected $finalUser;


public function __construct($user = null, $finalUser = false)
public function __construct($userId = null, $finalUser = false)
{
$this->user = $user;
$this->userId = $userId;
$this->finalUser = $finalUser;
}

Expand Down Expand Up @@ -104,7 +104,7 @@ public function failed($exception)
$mail_template->getValue('mail_subject'),
$mail_template->getValue('mail_body'),
$this->notify_id ?? -1,
$this->user->id,
$this->userId,
\Exment::getUserId() ?? null,
$this->mailHistory->getParentId(),
$this->mailHistory->getParentType()
Expand Down
4 changes: 2 additions & 2 deletions src/Notifications/MailSender.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ protected function sendMail()
->setFromName($fromName)
->setBodyType($bodyType);

$job = new MailSendJob(\Exment::user(), $this->final_user);
$job = new MailSendJob(\Exment::getUserId(), $this->final_user);
$job->setMailInfo($this->mailInfo)
->setMailHistory($this->mailHistory);
$this->notify($job);
Expand Down Expand Up @@ -281,7 +281,7 @@ protected function sendPasswordMail()
->setMailTemplate($mail_template)
->setHistory(false);

$job = new MailSendJob(\Exment::user(), $this->final_user);
$job = new MailSendJob(\Exment::getUserId(), $this->final_user);
$job->setMailInfo($mailInfo)
->setMailHistory($mailHistory);

Expand Down
Loading