本文整理匯總了PHP中emailer::sendMail方法的典型用法代碼示例。如果您正苦於以下問題:PHP emailer::sendMail方法的具體用法?PHP emailer::sendMail怎麽用?PHP emailer::sendMail使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類emailer
的用法示例。
在下文中一共展示了emailer::sendMail方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: l
$invalid['Session'] = l($testSession->getLastError());
}
} else {
//if user is asking to receive the activation email again
if ($paramResendActivate) {
//build activation link for email template (resetting activation and reset hashes)
$activationLinkForEmail = Auth::buildHashLink('account.activate.folder', array('username' => $user->username(), 'activation' => $user->activation()), true);
//set data to be used for replacing placeholders in activation email template
$emailTplData = array('emailTo' => $user->email(), 'emailFrom' => c::get('site.email.from'), 'emailReply' => c::get('site.email.reply'), 'siteName' => $site->title(), 'activationLink' => $activationLinkForEmail);
//istantiate new emailer object (the object itself will replace placeholders)
//the construct props indicate an email template file and a data array
$emailer = new emailer(c::get('account.email.templates.folder'), c::get('email.template.activation.hash'), c::get('email.template.file.ext'), $emailTplData);
//if the email template is found
if ($emailer->doesEmailTemplateExist()) {
//if email was correclty sent
if ($emailer->sendMail()) {
//add success message
$success['Account'] = l('activation.success.resend');
} else {
//add error: mail class returned an error
$invalid['Account'] = l('activation.fail.resend');
}
} else {
//add error: email template was not found
$invalid['Account'] = l('generic.fail.email.template.notFound');
}
} else {
//build activation link for view
$activationLinkForView = Auth::buildHashLink('account.activate.folder', array('username' => $user->username(), 'resendActivation' => 1), false);
//add error: invalid or expired hash
$invalid['Account'] = l('activation.fail.invalid.hash');