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


PHP EmailTemplate::getByName方法代码示例

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


在下文中一共展示了EmailTemplate::getByName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: gGetDb

     }
     $emailTemplate->setName($_POST['name']);
     $emailTemplate->setText($_POST['text']);
     $emailTemplate->setJsquestion($_POST['jsquestion']);
     if ($_GET['edit'] == $createdid) {
         // Both checkboxes on the main created message should always be enabled.
         $emailTemplate->setDefaultAction(EmailTemplate::CREATED);
         $emailTemplate->setActive(1);
         $emailTemplate->setPreloadOnly(0);
     } else {
         $emailTemplate->setDefaultAction($_POST['defaultaction']);
         $emailTemplate->setActive(isset($_POST['active']));
         $emailTemplate->setPreloadOnly(isset($_POST['preloadonly']));
     }
     // Check if the entered name already exists (since these names are going to be used as the labels for buttons on the zoom page).
     $nameCheck = EmailTemplate::getByName($_POST['name'], gGetDb());
     if ($nameCheck != false && $nameCheck->getId() != $_GET['edit']) {
         BootstrapSkin::displayAlertBox("That Email template name is already being used. Please choose another.");
         BootstrapSkin::displayInternalFooter();
         die;
     }
     $database->transactionally(function () use($database, $emailTemplate) {
         $emailTemplate->save();
         Logger::editedEmail($database, $emailTemplate);
         global $baseurl;
         Notification::emailEdited($emailTemplate);
         SessionAlert::success("Email template has been saved successfully.");
         header("Location: {$baseurl}/acc.php?action=emailmgmt");
     });
     die;
 }
开发者ID:FastLizard4,项目名称:waca,代码行数:31,代码来源:acc.php

示例2: testGetLabel

 /**
  * @depends testCreateAndGetEmailTemplateById
  */
 public function testGetLabel()
 {
     $emailTemplate = EmailTemplate::getByName('Test Email Template');
     $this->assertEquals(1, count($emailTemplate));
     $this->assertEquals('Email Template', $emailTemplate[0]::getModelLabelByTypeAndLanguage('Singular'));
     $this->assertEquals('Email Templates', $emailTemplate[0]::getModelLabelByTypeAndLanguage('Plural'));
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:10,代码来源:EmailTemplateTest.php

示例3: testSetInitializingHtmlContentForBuilderTemplates

 /**
  * @depends testCreateAndGetEmailTemplateById
  */
 public function testSetInitializingHtmlContentForBuilderTemplates()
 {
     $defaultDataMaker = new EmailTemplatesDefaultDataMaker();
     $defaultDataMaker->make();
     $predefinedTemplate = EmailTemplate::getByName('3 Columns with Hero');
     $this->assertNotEmpty($predefinedTemplate);
     $emailTemplate = EmailTemplateTestHelper::populate('set Test', 'setTest', 'Contact', null, null, EmailTemplate::TYPE_CONTACT, 0, EmailTemplate::BUILT_TYPE_BUILDER_TEMPLATE, $predefinedTemplate[0]->serializedData);
     $this->assertNotEmpty($emailTemplate->htmlContent);
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:12,代码来源:EmailTemplateTest.php


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