-
Notifications
You must be signed in to change notification settings - Fork 567
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Registration mail verification and some refactoring
- Loading branch information
Showing
15 changed files
with
274 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?php | ||
|
||
namespace App\Jobs; | ||
|
||
use App\Jobs\Job; | ||
use App\Models\User; | ||
use Request; | ||
use Illuminate\Contracts\Bus\SelfHandling; | ||
use Illuminate\Contracts\Mail\Mailer; | ||
|
||
class SendMail extends Job implements SelfHandling | ||
{ | ||
|
||
/** | ||
* User Model. | ||
* | ||
* @var App\Models\User | ||
*/ | ||
protected $user; | ||
|
||
/** | ||
* Create a new SendMailCommand instance. | ||
* | ||
* @param App\Models\User $user | ||
* @return void | ||
*/ | ||
public function __construct(User $user) | ||
{ | ||
$this->user = $user; | ||
} | ||
|
||
/** | ||
* Execute the job. | ||
* | ||
* @param Mailer $mailer | ||
* @return void | ||
*/ | ||
public function handle(Mailer $mailer) | ||
{ | ||
$data = [ | ||
'title' => trans('front/verify.email-title'), | ||
'intro' => trans('front/verify.email-intro'), | ||
'link' => trans('front/verify.email-link'), | ||
'confirmation_code' => $this->user->confirmation_code | ||
]; | ||
|
||
$mailer->send('emails.auth.verify', $data, function($message) { | ||
$message->to($this->user->email, $this->user->username) | ||
->subject(trans('front/verify.email-title')); | ||
}); | ||
} | ||
} |
Oops, something went wrong.