Skip to content

Commit

Permalink
Update UsesMailcoachMail.php
Browse files Browse the repository at this point in the history
  • Loading branch information
riasvdv authored Dec 19, 2023
1 parent f3d4ca4 commit af00634
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/Concerns/UsesMailcoachMail.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@
/** @mixin \Illuminate\Mail\Mailable */
trait UsesMailcoachMail
{
private bool $usingMailcoachMail = false;

public function mailcoachMail(string $mailName, array $replacements = []): self
{
$this->usingMailcoachMail = true;

$this->html = 'use-mailcoach-mail';

$this->replacing($replacements);
Expand Down Expand Up @@ -44,4 +48,17 @@ public function replacing(array|string $key, string $value = null): self

return $this;
}

protected function buildSubject($message): self
{
if (! $this->usingMailcoachMail) {
return parent::buildSubject($message);
}

if ($this->subject) {
$message->subject($this->subject);
}

return $this;
}
}

0 comments on commit af00634

Please sign in to comment.