openclassify/app/Notification/ActivateYourAccount.php
MostafaMoradii 156e18b600
reset password email link issue.
when we are using a queue system to send Emails. we encountered a problem with the reset link in the email. To solve it, I changed the sending of this email from queue mode to instant mode.
2023-10-27 18:25:21 +03:00

65 lines
1.8 KiB
PHP

<?php namespace App\Notification;
use Anomaly\Streams\Platform\Notification\Message\MailMessage;
use Anomaly\UsersModule\User\Contract\UserInterface;
use Illuminate\Notifications\Notification;
/**
* Class ActivateYourAccount
*
* @link http://pyrocms.com/
* @author PyroCMS, Inc. <support@pyrocms.com>
* @author Ryan Thompson <ryan@pyrocms.com>
*/
class ActivateYourAccount extends Notification
{
/**
* Redirect here after activating.
*
* @var string
*/
public $redirect;
/**
* Create a new UserHasRegistered instance.
*
* @param $redirect
*/
public function __construct($redirect = '/')
{
$this->redirect = $redirect;
}
/**
* Get the notification's delivery channels.
*
* @param UserInterface $notifiable
* @return array
*/
public function via(UserInterface $notifiable)
{
return ['mail'];
}
/**
* Return the mail message.
*
* @param UserInterface $notifiable
* @return MailMessage
*/
public function toMail(UserInterface $notifiable)
{
$data = $notifiable->attributesToArray();
return (new MailMessage())
->view('anomaly.module.users::notifications.activate_your_account',$data)
->subject(trans('anomaly.module.users::notification.activate_your_account.subject', $data))
->greeting(trans('anomaly.module.users::notification.activate_your_account.greeting', $data))
->line(trans('anomaly.module.users::notification.activate_your_account.instructions', $data))
->action(
trans('anomaly.module.users::notification.activate_your_account.button', $data),
$notifiable->route('activate', ['redirect' => $this->redirect])
);
}
}