- Complete GGZ Ecademy Laravel backend application - RESTful API for learning products, members, filters - Authentication and authorization system - Database migrations and seeders - Custom CRUD generator commands - Email notification system - Integration with frontend applications
This commit is contained in:
51
app/Mail/MemberChanges.php
Normal file
51
app/Mail/MemberChanges.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
namespace App\Mail;
|
||||
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use League\HTMLToMarkdown\HtmlConverter;
|
||||
|
||||
class MemberChanges extends Mailable implements ShouldQueue
|
||||
{
|
||||
use Queueable, SerializesModels;
|
||||
|
||||
public $notification;
|
||||
|
||||
public $email;
|
||||
public $subject = 'Wijzigingen in MijnGGZ Ecademy';
|
||||
|
||||
/**
|
||||
* Create a new message instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($notification)
|
||||
{
|
||||
$this->notification = $notification;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the message.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function build()
|
||||
{
|
||||
|
||||
$converter = new HtmlConverter();
|
||||
|
||||
$this->notification->message = $converter->convert($this->notification->message);
|
||||
|
||||
$link = env('APP_URL_FRONTEND', 'http://localhost:3000') . "/manager/members/" . $this->notification->member->slug;
|
||||
|
||||
return $this->from(env('MAIL_FROM_ADDRESS'))
|
||||
->with([
|
||||
'notification' => $this->notification,
|
||||
'link' => $link
|
||||
])
|
||||
->markdown('emails.members.hasChanges');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user