protected validation ( Cake\Datasource\EntityInterface $user, string $subject, string $template = 'CakeDC/Users.validation' ) : array | ||
$user | Cake\Datasource\EntityInterface | User entity |
$subject | string | Subject, note the first_name of the user will be prepended if exist |
$template | string | string, note the first_name of the user will be prepended if exists |
return | array | email send result |
protected function validation(EntityInterface $user, $subject, $template = 'CakeDC/Users.validation')
{
$firstName = isset($user['first_name']) ? $user['first_name'] . ', ' : '';
$user->hiddenProperties(['password', 'token_expires', 'api_token']);
$this->to($user['email'])->subject($firstName . $subject)->viewVars($user->toArray())->template($template);
}