Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FIX Ensure HTML email preview content is parsed as HTML including sho…
…rtcodes
- Loading branch information
1 parent
802c750
commit bf20e19
Showing
3 changed files
with
35 additions
and
4 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
24 changes: 24 additions & 0 deletions
24
tests/model/recipients/UserDefinedForm_EmailRecipientTest.php
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
class UserDefinedForm_EmailRecipientTest extends SapphireTest | ||
{ | ||
protected static $fixture_file = 'UserDefinedForm_EmailRecipientTest.yml'; | ||
|
||
public function testShortcodesAreRenderedInEmailPreviewContent() | ||
{ | ||
$page = $this->objFromFixture('SiteTree', 'about_us'); | ||
|
||
$recipient = UserDefinedForm_EmailRecipient::create(); | ||
$recipient->SendPlain = false; | ||
$recipient->EmailBodyHtml = '<p>Some email content. About us: [sitetree_link,id=' . $page->ID . '].</p>'; | ||
|
||
$result = $recipient->getEmailBodyContent(); | ||
$this->assertContains('/about-us/', $result); | ||
|
||
$recipient->SendPlain = true; | ||
$recipient->EmailBody = 'Some email content. About us: [sitetree_link,id=' . $page->ID . '].'; | ||
|
||
$result = $recipient->getEmailBodyContent(); | ||
$this->assertContains('/about-us/', $result); | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
tests/model/recipients/UserDefinedForm_EmailRecipientTest.yml
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
SiteTree: | ||
about_us: | ||
Title: About Us | ||
URLSegment: about-us |