How i can get the response from mailgun using Laravel mail.
Here is my code.
// In User Model.
$mail = Mail::send([], [], function ($message) use ($parsed_template) {
$message
->to('[email protected]')
->subject('Test')
->setBody($parsed_template, 'text/html')
->addPart('Hello, welcome to Laravel!', 'text/plain');
});
I can get the response in the the Listner using the Mailgun EVENT.
protected $listen = [
Registered::class => [
SendEmailVerificationNotification::class,
],
'IlluminateMailEventsMessageSent' => [
'AppListenersMailGunMailListner',
],
];
// 'AppListenersMailGunMailListner',
public function handle(MessageSent $event)
{
dd($event->message->getId());
}
I can get the response in the listener, But How I can access it in the User model.
Thanks