本文整理汇总了PHP中emailer::doesEmailTemplateExist方法的典型用法代码示例。如果您正苦于以下问题:PHP emailer::doesEmailTemplateExist方法的具体用法?PHP emailer::doesEmailTemplateExist怎么用?PHP emailer::doesEmailTemplateExist使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类emailer
的用法示例。
在下文中一共展示了emailer::doesEmailTemplateExist方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: l
} else {
//add error: there was a problem creating user's results file
$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);