本文整理汇总了PHP中EmailTemplate::setBody方法的典型用法代码示例。如果您正苦于以下问题:PHP EmailTemplate::setBody方法的具体用法?PHP EmailTemplate::setBody怎么用?PHP EmailTemplate::setBody使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EmailTemplate
的用法示例。
在下文中一共展示了EmailTemplate::setBody方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: executeAjaxSave
public function executeAjaxSave(sfWebRequest $request)
{
$template = trim($request->getParameter('template'));
if (empty($template)) {
return $this->renderText('Please specify template name');
}
$email_template = new EmailTemplate();
$email_template->setName($template);
$email_template->setSubject($request->getParameter('subject'));
$email_template->setSenderEmail($request->getParameter('email'));
$email_template->setSenderName($request->getParameter('name'));
$email_template->setBody($request->getParameter('body'));
$email_template->setPersonId($this->getUser()->getId());
$email_template->save();
return $this->renderText('#New template have successfully saved!');
}
示例2: EmailTemplate
/**
* Internal function to return an email template object from a row.
* @param $row array
* @return EmailTemplate
*/
function &_returnEmailTemplateFromRow(&$row)
{
$emailTemplate = new EmailTemplate();
$emailTemplate->setEmailKey($row['email_key']);
$emailTemplate->setEnabled($row['enabled']);
$emailTemplate->setCanDisable($row['can_disable']);
if (!HookRegistry::call('EmailTemplateDAO::_returnEmailTemplateFromRow', array(&$emailTemplate, &$row))) {
$result =& $this->retrieve('SELECT d.locale, d.description, d.subject, d.body
FROM email_templates_data AS d
WHERE d.email_key = ?', $row['email_key']);
while (!$result->EOF) {
$dataRow =& $result->GetRowAssoc(false);
$emailTemplate->addLocale($dataRow['locale']);
$emailTemplate->setSubject($dataRow['locale'], $dataRow['subject']);
$emailTemplate->setBody($dataRow['locale'], $dataRow['body']);
$emailTemplate->setDescription($dataRow['locale'], $dataRow['description']);
$result->MoveNext();
}
$result->Close();
unset($result);
}
return $emailTemplate;
}
示例3: EmailTemplate
/**
* Internal function to return an email template object from a row.
* @param $row array
* @return EmailTemplate
*/
function &_returnEmailTemplateFromRow(&$row, $isCustomTemplate = null)
{
$emailTemplate = new EmailTemplate();
$emailTemplate->setEmailId($row['email_id']);
$emailTemplate->setAssocType($row['assoc_type']);
$emailTemplate->setAssocId($row['assoc_id']);
$emailTemplate->setEmailKey($row['email_key']);
$emailTemplate->setLocale($row['locale']);
$emailTemplate->setSubject($row['subject']);
$emailTemplate->setBody($row['body']);
$emailTemplate->setEnabled($row['enabled'] == null ? 1 : $row['enabled']);
$emailTemplate->setCanDisable($row['can_disable']);
$emailTemplate->setFromRoleId($row['from_role_id']);
$emailTemplate->setToRoleId($row['to_role_id']);
if ($isCustomTemplate !== null) {
$emailTemplate->setCustomTemplate($isCustomTemplate);
}
HookRegistry::call('EmailTemplateDAO::_returnEmailTemplateFromRow', array(&$emailTemplate, &$row));
return $emailTemplate;
}