Completed
Push — master ( bab605...567ed5 )
by Sebastian
04:30
created

MemberMailer::userWasCreatedThroughBack()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 6
rs 9.4285
c 1
b 0
f 0
1
<?php
2
3
namespace App\Services\Mailers;
4
5
use App\Events\UserWasActivated;
6
use App\Services\Auth\Front\Events\UserWasCreatedThroughBack;
7
use App\Services\Auth\Front\Events\UserWasRegistered;
8
use Illuminate\Contracts\Events\Dispatcher;
9
10
class MemberMailer
11
{
12
    use SendsMails;
13
    
14
    public function userWasRegistered(UserWasRegistered $event)
15
    {
16
        $this->sendTo(
0 ignored issues
show
Bug introduced by
The method sendTo() does not seem to exist on object<App\Services\Mailers\MemberMailer>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
17
            $event->user->email,
18
            'Welkom bij ' . config('app.url'),
19
            'emails.auth.front.welcome',
20
            ['userId' => $event->user->id]
21
        );
22
    }
23
24
    public function userWasCreatedThroughBack(UserWasCreatedThroughBack $event)
25
    {
26
        Password::broker('front')->sendResetLink(['email' => $event->user->email], function (Message $message) {
27
            $message->subject('Welkom bij ' . config('app.url'));
28
        });
29
    }
30
31
    public function subscribe(Dispatcher $events)
32
    {
33
        $events->listen(UserWasCreatedThroughBack::class, [$this, 'userWasCreatedThroughBack']);
34
    }
35
}
36