new app store assets ready for relese
This commit is contained in:
@@ -1,12 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Notifications;
|
||||
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Notifications\Notification;
|
||||
use Illuminate\Notifications\Messages\MailMessage;
|
||||
class AccountUpdate extends Notification implements ShouldQueue {
|
||||
use Queueable;
|
||||
public function __construct(public string $subject, public string $message, public string $url) { $this->afterCommit(); }
|
||||
public function via(object $notifiable): array {return ['mail'];}
|
||||
public function toMail(object $notifiable): MailMessage {return (new MailMessage)->subject($this->subject)->line($this->message)->action('Open your account',$this->url);}
|
||||
use Illuminate\Notifications\Notification;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class AccountUpdate extends Notification implements ShouldQueue
|
||||
{
|
||||
use Queueable;
|
||||
|
||||
public function __construct(public string $subject, public string $message, public string $url, public ?string $template = null)
|
||||
{
|
||||
$this->afterCommit();
|
||||
}
|
||||
|
||||
public function via(object $notifiable): array
|
||||
{
|
||||
return ['mail'];
|
||||
}
|
||||
|
||||
public function toMail(object $notifiable): MailMessage
|
||||
{
|
||||
$template = $this->template ? DB::table('email_templates')->where('slug', $this->template)->first() : null;
|
||||
|
||||
return (new MailMessage)->subject($template?->subject ?? $this->subject)->line($template?->body ?? $this->message)->action('Open your account', $this->url);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user