Skip to content

Commit

Permalink
Shorten construct method
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcyLina committed Sep 27, 2024
1 parent 6a2d9f7 commit 431eb19
Showing 1 changed file with 32 additions and 37 deletions.
69 changes: 32 additions & 37 deletions app/Mail/ResourceDigestEmail.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,41 +11,36 @@

class ResourceDigestEmail extends Mailable implements ShouldQueue
{
use Queueable, SerializesModels;

public $resources;
public $user;
public $unsubscribeUrl;

public function __construct($resources, $user, $unsubscribeUrl)
{
$this->resources = $resources;
$this->user = $user;
$this->unsubscribeUrl = $unsubscribeUrl;
}

public function envelope()
{
return new Envelope(
subject: 'New Onramp Resources!',
from: '[email protected]',
);
}

public function content()
{
return new Content(
markdown: 'emails.resource-digest',
with: [
'resources' => $this->resources,
'user' => $this->user,
'unsubscribeUrl' => $this->unsubscribeUrl,
],
);
}

public function attachments(): array
{
return [];
}
use Queueable, SerializesModels;

public function __construct(
public $resources,
public $user,
public $unsubscribeUrl
) {}

public function envelope()
{
return new Envelope(
subject: 'New Onramp Resources!',
from: '[email protected]',
);
}

public function content()
{
return new Content(
markdown: 'emails.resource-digest',
with: [
'resources' => $this->resources,
'user' => $this->user,
'unsubscribeUrl' => $this->unsubscribeUrl,
],
);
}

public function attachments(): array
{
return [];
}
}

0 comments on commit 431eb19

Please sign in to comment.