fixed shortcode edit issues plus refactoring
This commit is contained in:
40
app/Notifications/EmailNotification.php
Normal file
40
app/Notifications/EmailNotification.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
namespace App\Notifications;
|
||||
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Notifications\Notification;
|
||||
use Illuminate\Notifications\Messages\MailMessage;
|
||||
|
||||
class EmailNotification extends Notification
|
||||
{
|
||||
use Queueable;
|
||||
|
||||
protected $message;
|
||||
protected $url;
|
||||
|
||||
public function __construct($message, $url = null)
|
||||
{
|
||||
$this->message = $message;
|
||||
$this->url = $url;
|
||||
}
|
||||
|
||||
public function via($notifiable)
|
||||
{
|
||||
return ['mail']; // Use 'mail' channel
|
||||
}
|
||||
|
||||
public function toMail($notifiable)
|
||||
{
|
||||
$mailMessage = (new MailMessage)
|
||||
->greeting('Hello!')
|
||||
->line($this->message);
|
||||
|
||||
if ($this->url) {
|
||||
$mailMessage->action('View Details', $this->url);
|
||||
}
|
||||
|
||||
return $mailMessage->salutation('Regards, Your Application');
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user