/
var
/
www
/
vhosts
/
ihelp.ro
/
httpdocs
/
vendor
/
cakedc
/
users
/
src
/
Mailer
/
/var/www/vhosts/ihelp.ro/httpdocs/vendor/cakedc/users/src/Mailer
mkdir
upload
Name
Size
Mode
Actions
UsersMailer.php
2939
0644
edit
dl
rm
Edit:
/var/www/vhosts/ihelp.ro/httpdocs/vendor/cakedc/users/src/Mailer/UsersMailer.php
(2939B)
<?php declare(strict_types=1); /** * Copyright 2010 - 2019, Cake Development Corporation (https://www.cakedc.com) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @copyright Copyright 2010 - 2018, Cake Development Corporation (https://www.cakedc.com) * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ namespace CakeDC\Users\Mailer; use Cake\Datasource\EntityInterface; use Cake\Mailer\Mailer; /** * User Mailer * */ class UsersMailer extends Mailer { /** * Send the templated email to the user * * @param \Cake\Datasource\EntityInterface $user User entity * @return void */ protected function validation(EntityInterface $user) { $firstName = isset($user['first_name']) ? $user['first_name'] . ', ' : ''; // un-hide the token to be able to send it in the email content $user->setHidden(['password', 'token_expires', 'api_token']); $subject = __d('cake_d_c/users', 'Your account validation link'); $this ->setTo($user['email']) ->setSubject($firstName . $subject) ->setViewVars($user->toArray()) ->viewBuilder()->setTemplate('CakeDC/Users.validation'); } /** * Send the reset password email to the user * * @param \Cake\Datasource\EntityInterface $user User entity * * @return void */ protected function resetPassword(EntityInterface $user) { $firstName = isset($user['first_name']) ? $user['first_name'] . ', ' : ''; $subject = __d('cake_d_c/users', '{0}Your reset password link', $firstName); // un-hide the token to be able to send it in the email content $user->setHidden(['password', 'token_expires', 'api_token']); $this ->setTo($user['email']) ->setSubject($subject) ->setViewVars($user->toArray()); $this ->viewBuilder() ->setTemplate('CakeDC/Users.resetPassword'); } /** * Send account validation email to the user * * @param \Cake\Datasource\EntityInterface $user User entity * @param \Cake\Datasource\EntityInterface $socialAccount SocialAccount entity * * @return void */ protected function socialAccountValidation(EntityInterface $user, EntityInterface $socialAccount) { $firstName = isset($user['first_name']) ? $user['first_name'] . ', ' : ''; // note: we control the space after the username in the previous line $subject = __d('cake_d_c/users', '{0}Your social account validation link', $firstName); $this ->setTo($user['email']) ->setSubject($subject) ->setViewVars(compact('user', 'socialAccount')); $this ->viewBuilder() ->setTemplate('CakeDC/Users.socialAccountValidation'); } }
Save
cmd:
run