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


PHP EmailTemplate::getByType方法代码示例

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


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

示例1: testListForWorkflowAction

 /**
  * @depends testListForMarketingAction
  */
 public function testListForWorkflowAction()
 {
     $content = $this->runControllerWithNoExceptionsAndGetContent('emailTemplates/default/listForWorkflow');
     $this->assertContains('Email Templates</title></head>', $content);
     $this->assertContains('1 result', $content);
     $this->assertEquals(substr_count($content, 'Test Name'), 1);
     $this->assertEquals(substr_count($content, strval($this->user)), 2);
     $this->assertEquals(substr_count($content, '<td>HTML</td>'), 1);
     $emailTemplates = EmailTemplate::getByType(EmailTemplate::TYPE_WORKFLOW);
     $this->assertEquals(1, count($emailTemplates));
 }
开发者ID:spiogit,项目名称:cna-seed-project,代码行数:14,代码来源:EmailTemplatesSuperUserWalkthroughTest.php

示例2: getAvailableContactEmailTemplateNamesArray

 protected function getAvailableContactEmailTemplateNamesArray()
 {
     $emailTemplates = EmailTemplate::getByType(EmailTemplate::TYPE_CONTACT);
     $emailTemplatesArray = array();
     foreach ($emailTemplates as $emailTemplate) {
         $emailTemplatesArray[$emailTemplate->id] = $emailTemplate->name;
     }
     asort($emailTemplatesArray);
     return $emailTemplatesArray;
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:10,代码来源:ContactEmailTemplateNamesDropDownElement.php

示例3: testSuperUserListForWorkflowAction

 /**
  * @depends testSuperUserListForMarketingAction
  */
 public function testSuperUserListForWorkflowAction()
 {
     $content = $this->runControllerWithNoExceptionsAndGetContent('emailTemplates/default/listForWorkflow');
     $this->assertTrue(strpos($content, 'Email Templates</title></head>') !== false);
     $this->assertTrue(strpos($content, '1 result') !== false);
     $this->assertEquals(substr_count($content, 'Test Name'), 1);
     $this->assertEquals(substr_count($content, 'Clark Kent'), 1);
     $emailTemplates = EmailTemplate::getByType(EmailTemplate::TYPE_WORKFLOW);
     $this->assertEquals(1, count($emailTemplates));
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:13,代码来源:EmailTemplatesSuperUserWalkthroughTest.php

示例4: testGetByType

 /**
  * @depends testCreateAndGetEmailTemplateById
  */
 public function testGetByType()
 {
     EmailTemplate::deleteAll();
     // create 2 predefined non-builder templates for each type
     EmailTemplateTestHelper::create('predefined 01', 'subject 01', null);
     EmailTemplateTestHelper::create('predefined 02', 'subject 02', null);
     EmailTemplateTestHelper::create('predefined 03', 'subject  03', null, 'html', 'text', EmailTemplate::TYPE_WORKFLOW);
     EmailTemplateTestHelper::create('predefined 04', 'subject  04', null, 'html', 'text', EmailTemplate::TYPE_WORKFLOW);
     // create 2 contact type, 1 draft 1 non draft
     EmailTemplateTestHelper::create('contact 01', 'subject 01', 'Contact', 'html', 'text');
     EmailTemplateTestHelper::create('contact 02', 'subject 02', 'Contact', 'html', 'text', EmailTemplate::TYPE_CONTACT, 1);
     // create 2 workflow type, 1 draft 1 non draft
     EmailTemplateTestHelper::create('workflow 01', 'subject 01', 'Note', 'html', 'text', EmailTemplate::TYPE_WORKFLOW);
     EmailTemplateTestHelper::create('workflow 02', 'subject 02', 'Note', 'html', 'text', EmailTemplate::TYPE_WORKFLOW, 1);
     // a- contact, exclude draft
     $nonDraftContactTemplates = EmailTemplate::getByType(EmailTemplate::TYPE_CONTACT);
     $this->assertCount(1, $nonDraftContactTemplates);
     $this->assertEquals('contact 01', $nonDraftContactTemplates[0]->name);
     // b- contact, include drafts
     $nonDraftContactTemplates = EmailTemplate::getByType(EmailTemplate::TYPE_CONTACT, true);
     $this->assertCount(2, $nonDraftContactTemplates);
     $this->assertEquals('contact 01', $nonDraftContactTemplates[0]->name);
     $this->assertEquals('contact 02', $nonDraftContactTemplates[1]->name);
     // c- workflow, exclude draft
     $nonDraftContactTemplates = EmailTemplate::getByType(EmailTemplate::TYPE_WORKFLOW);
     $this->assertCount(1, $nonDraftContactTemplates);
     $this->assertEquals('workflow 01', $nonDraftContactTemplates[0]->name);
     // d- workflow, include drafts
     $nonDraftContactTemplates = EmailTemplate::getByType(EmailTemplate::TYPE_WORKFLOW, true);
     $this->assertCount(2, $nonDraftContactTemplates);
     $this->assertEquals('workflow 01', $nonDraftContactTemplates[0]->name);
     $this->assertEquals('workflow 02', $nonDraftContactTemplates[1]->name);
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:36,代码来源:EmailTemplateTest.php


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