-
-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #4919 - Add support for quick custom email template without sep…
…arate file.
- Loading branch information
Showing
2 changed files
with
46 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,6 +68,41 @@ public function testArraySet() | |
$this->assertStringNotContainsString('{MEDIA1}', $this->eml->Body); | ||
} | ||
|
||
/** | ||
* Test using a custom template passed directly. | ||
* @return void | ||
*/ | ||
public function testArraySetInlineTemplate() | ||
{ | ||
$eml = array( | ||
'subject' => "[CUSTOM TEMPLATE EXAMPLE]", | ||
'sender_email' => "[email protected]", | ||
'sender_name' => "Test Person", | ||
'replyto' => "", | ||
'html' => true, | ||
'priority' => 1, | ||
'template' => ['subject'=>'{SUBJECT}', 'header'=>'<html lang="en"><body>', 'body'=>'<div><span>{NAME}</span> <small>{DATE}</small></div><div>{BODY}</div>', 'footer'=>'</body></html>'], | ||
'body' => "This is the body text", | ||
'cc' => '', | ||
'shortcodes' => [ | ||
'NAME' => "TestName", | ||
'DATE' => 'Jan 1st, 2020' | ||
], | ||
); | ||
|
||
$this->eml->arraySet($eml); | ||
|
||
$this->assertStringContainsString("[email protected]", $this->eml->From); | ||
$this->assertStringContainsString("Test Person", $this->eml->FromName); | ||
$this->assertStringContainsString("[CUSTOM TEMPLATE EXAMPLE]", $this->eml->Subject); | ||
|
||
$this->assertStringContainsString('<html lang="en"><body>', $this->eml->Body); | ||
|
||
$this->assertStringContainsString('<div><span>TestName</span> <small>Jan 1st, 2020</small></div><div>This is the body text</div>', $this->eml->Body); | ||
$this->assertStringNotContainsString('{MEDIA1}', $this->eml->Body); | ||
} | ||
|
||
|
||
/** | ||
* Test using an email template from e107_plugins/_blank/templates/_blank_template.php | ||
* @return void | ||
|
@@ -103,6 +138,8 @@ public function testArraySetPluginTemplate() | |
} | ||
|
||
|
||
|
||
|
||
public function testArraySetNotifyTemplate() | ||
{ | ||
$eml = array( | ||
|