本文整理汇总了PHP中Emails::SendEmail方法的典型用法代码示例。如果您正苦于以下问题:PHP Emails::SendEmail方法的具体用法?PHP Emails::SendEmail怎么用?PHP Emails::SendEmail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Emails
的用法示例。
在下文中一共展示了Emails::SendEmail方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: RecoverPassword
public static function RecoverPassword($id, $request_type = null)
{
//Generate Random Password of 6 characters
$password = self::GenerateRandomPassword(Constant::PASSWORD_MIMIMUM_LENGTH);
//Encrypt password
$password_encrypted = self::EncryptPassword($password);
//check if this employee exists
$employee = EmployeePeer::retrieveByPK($id);
if ($employee) {
$employee->setPassword($password_encrypted);
//Set newly created password to databaes
if ($employee->save()) {
//send the new password and other details to use via email
//prepare the constants that will be replaced in email body
$email_vars = array('USER' => $employee->getName(), 'EMAIL' => $employee->getEmail(), 'PASSWORD' => $password);
Emails::SendEmail($employee->getEmail(), $request_type, $email_vars);
return Constant::LOGIN_PASSWORD_SENT_SUCCESS;
} else {
return Constant::DB_ERROR;
}
} else {
return Constant::LOGIN_INVALIDATION_EMAIL_FIELD;
}
}