-
app/Actions/Submission/ApproveStreamAction.php
Open in GitHubuse App\Mail\StreamApprovedMail; use App\Models\Stream; use Illuminate\Support\Facades\Mail; class ApproveStreamAction { public function handle(Stream $stream) { if (! is_null($stream->approved_at)) { return; } $stream->approved_at = now(); $stream->save(); Mail::to($stream->submitted_by_email)->queue(new StreamApprovedMail($stream)); } }
-
app/Mail/StreamApprovedMail.php
Open in GitHubuse App\Models\Stream; use Illuminate\Mail\Mailable; class StreamApprovedMail extends Mailable { public function __construct( public Stream $stream ) {} public function build() { return $this ->subject("The stream you've submitted has been approved") ->markdown('mail.approved'); } }