36 lines
857 B
PHP
36 lines
857 B
PHP
<?php
|
|
|
|
namespace App\Mail\Drip;
|
|
|
|
use App\Models\User;
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Mail\Mailable;
|
|
use Illuminate\Mail\Mailables\Content;
|
|
use Illuminate\Mail\Mailables\Envelope;
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
class PromoCodeEmail extends Mailable
|
|
{
|
|
use Queueable, SerializesModels;
|
|
|
|
public function __construct(public User $user) {}
|
|
|
|
public function envelope(): Envelope
|
|
{
|
|
return new Envelope(
|
|
subject: 'Your Founder Discount - First Month for $1',
|
|
)->from(config('mail.from.address', 'hello@example.com'), 'Victor');
|
|
}
|
|
|
|
public function content(): Content
|
|
{
|
|
return new Content(
|
|
markdown: 'mail.drip.promo-code',
|
|
with: [
|
|
'userName' => $this->user->name,
|
|
'promoCode' => 'FOUNDER',
|
|
],
|
|
);
|
|
}
|
|
}
|