app/controllers/UserController.php: in settingsAction() send the activation email :)
This commit is contained in:
parent
9432f189aa
commit
a2abf940b5
1 changed files with 15 additions and 2 deletions
|
|
@ -5,7 +5,8 @@ namespace App\Controller;
|
|||
use App\Controller\ControllerBase,
|
||||
App\Form\UserSettings as UserSettingsForm,
|
||||
App\Model\Data\ActivityLog,
|
||||
App\Model\Data\PasswordLink;
|
||||
App\Model\Data\PasswordLink,
|
||||
SendGrid\Mail\Mail as SendGridMail;
|
||||
|
||||
class UserController extends ControllerBase
|
||||
{
|
||||
|
|
@ -36,7 +37,19 @@ class UserController extends ControllerBase
|
|||
->setPassword($hash)
|
||||
->save();
|
||||
|
||||
// TODO: Send the email here.
|
||||
$tpl = $this->di->get('template');
|
||||
$body = $tpl->render('mail/password_activation', [
|
||||
'link' => $link->getPublicId()
|
||||
]);
|
||||
|
||||
$mail = new SendGridMail();
|
||||
$mail->setFrom('noreply@shufflingpixels.com');
|
||||
$mail->setSubject('Httpcb password activation');
|
||||
$mail->addTo($user->getEmail());
|
||||
$mail->addContent('text/html', $body);
|
||||
|
||||
$sendgrid = $this->di->get('sendgrid');
|
||||
$sendgrid->send($mail);
|
||||
|
||||
$msg = "For security reasons. Before a password can be created "
|
||||
. "a email has been sent to <strong>{$user->getEmail()}</strong> with "
|
||||
|
|
|
|||
Reference in a new issue