当前位置: 首页>>代码示例>>PHP>>正文


PHP EmailTemplate::setName方法代码示例

本文整理汇总了PHP中EmailTemplate::setName方法的典型用法代码示例。如果您正苦于以下问题:PHP EmailTemplate::setName方法的具体用法?PHP EmailTemplate::setName怎么用?PHP EmailTemplate::setName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在EmailTemplate的用法示例。


在下文中一共展示了EmailTemplate::setName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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!');
 }
开发者ID:yasirgit,项目名称:afids,代码行数:16,代码来源:actions.class.php

示例2: messages

 global $smarty, $createdid, $availableRequestStates;
 /* New page for managing Emails, since I would rather not be handling editing
 	interface messages (such as the Sitenotice) and the new Emails in the same place. */
 if (isset($_GET['create'])) {
     if (!User::getCurrent()->isAdmin()) {
         BootstrapSkin::displayAccessDenied();
         BootstrapSkin::displayInternalFooter();
         die;
     }
     if (isset($_POST['submit'])) {
         $database = gGetDb();
         $database->transactionally(function () use($database) {
             global $baseurl;
             $emailTemplate = new EmailTemplate();
             $emailTemplate->setDatabase($database);
             $emailTemplate->setName($_POST['name']);
             $emailTemplate->setText($_POST['text']);
             $emailTemplate->setJsquestion($_POST['jsquestion']);
             $emailTemplate->setDefaultAction($_POST['defaultaction']);
             $emailTemplate->setActive(isset($_POST['active']));
             // Check if the entered name already exists (since these names are going to be used as the labels for buttons on the zoom page).
             // getByName(...) returns false on no records found.
             if (EmailTemplate::getByName($_POST['name'], $database)) {
                 throw new TransactionException("That Email template name is already being used. Please choose another.");
             }
             $emailTemplate->save();
             Logger::createEmail($database, $emailTemplate);
             Notification::emailCreated($emailTemplate);
             SessionAlert::success("Email template has been saved successfully.");
             header("Location: {$baseurl}/acc.php?action=emailmgmt");
         });
开发者ID:FastLizard4,项目名称:waca,代码行数:31,代码来源:acc.php


注:本文中的EmailTemplate::setName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。