|
1
|
|
|
<?php namespace Anomaly\UsersModule\User\Notification; |
|
2
|
|
|
|
|
3
|
|
|
use Anomaly\Streams\Platform\Notification\Message\MailMessage; |
|
4
|
|
|
use Anomaly\UsersModule\User\Contract\UserInterface; |
|
5
|
|
|
use Illuminate\Bus\Queueable; |
|
6
|
|
|
use Illuminate\Notifications\Notification; |
|
7
|
|
|
|
|
8
|
|
|
/** |
|
9
|
|
|
* Class ActivateYourAccount |
|
10
|
|
|
* |
|
11
|
|
|
* @link http://pyrocms.com/ |
|
12
|
|
|
* @author PyroCMS, Inc. <[email protected]> |
|
13
|
|
|
* @author Ryan Thompson <[email protected]> |
|
14
|
|
|
*/ |
|
15
|
|
|
class ActivateYourAccount extends Notification |
|
16
|
|
|
{ |
|
17
|
|
|
|
|
18
|
|
|
use Queueable; |
|
19
|
|
|
|
|
20
|
|
|
/** |
|
21
|
|
|
* Redirect here after activating. |
|
22
|
|
|
* |
|
23
|
|
|
* @var string |
|
24
|
|
|
*/ |
|
25
|
|
|
public $redirect; |
|
26
|
|
|
|
|
27
|
|
|
/** |
|
28
|
|
|
* Create a new UserHasRegistered instance. |
|
29
|
|
|
* |
|
30
|
|
|
* @param $redirect |
|
31
|
|
|
*/ |
|
32
|
|
|
public function __construct($redirect = '/') |
|
33
|
|
|
{ |
|
34
|
|
|
$this->redirect = $redirect; |
|
35
|
|
|
} |
|
36
|
|
|
|
|
37
|
|
|
/** |
|
38
|
|
|
* Get the notification's delivery channels. |
|
39
|
|
|
* |
|
40
|
|
|
* @param UserInterface $notifiable |
|
41
|
|
|
* @return array |
|
42
|
|
|
*/ |
|
43
|
|
|
public function via(UserInterface $notifiable) |
|
44
|
|
|
{ |
|
45
|
|
|
return ['mail']; |
|
46
|
|
|
} |
|
47
|
|
|
|
|
48
|
|
|
/** |
|
49
|
|
|
* Return the mail message. |
|
50
|
|
|
* |
|
51
|
|
|
* @param UserInterface $notifiable |
|
52
|
|
|
* @return MailMessage |
|
53
|
|
|
*/ |
|
54
|
|
|
public function toMail(UserInterface $notifiable) |
|
55
|
|
|
{ |
|
56
|
|
|
$data = $notifiable->toArray(); |
|
57
|
|
|
|
|
58
|
|
|
return (new MailMessage()) |
|
59
|
|
|
->view('anomaly.module.users::notifications.activate_your_account') |
|
60
|
|
|
->subject(trans('anomaly.module.users::notification.activate_your_account.subject', $data)) |
|
61
|
|
|
->greeting(trans('anomaly.module.users::notification.activate_your_account.greeting', $data)) |
|
62
|
|
|
->line(trans('anomaly.module.users::notification.activate_your_account.instructions', $data)) |
|
63
|
|
|
->action( |
|
64
|
|
|
trans('anomaly.module.users::notification.activate_your_account.button', $data), |
|
65
|
|
|
$notifiable->route('activate', ['redirect' => $this->redirect]) |
|
66
|
|
|
); |
|
67
|
|
|
} |
|
68
|
|
|
} |
|
69
|
|
|
|