Adds unit test for "preview" mode, which replaces system links with
hashes in preview emails
This commit is contained in:
@@ -590,6 +590,10 @@ class NewslettersTest extends MailPoetTest {
|
||||
expect($newsletter['body']['text'])->contains('Hello test');
|
||||
expect($subscriber)->equals($subscriber);
|
||||
expect($extra_params['unsubscribe_url'])->equals(home_url());
|
||||
// system links are replaced with hashes
|
||||
expect($newsletter['body']['html'])->contains('href="#">View in browser');
|
||||
expect($newsletter['body']['html'])->contains('href="#">Unsubscribe');
|
||||
expect($newsletter['body']['html'])->contains('href="#">Manage subscription');
|
||||
return array('response' => true);
|
||||
}
|
||||
)
|
||||
|
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
use Codeception\Util\Fixtures;
|
||||
|
||||
$newsletter_body_text =
|
||||
|
||||
Fixtures::add(
|
||||
'newsletter_body_template',
|
||||
'{
|
||||
@@ -20,7 +22,7 @@ Fixtures::add(
|
||||
"blocks": [
|
||||
{
|
||||
"type": "text",
|
||||
"text": "<a data-post-id=\"10\" href=\"http://example.com\">Link</a>Hello [subscriber:firstname | default:test]"
|
||||
"text": "<a href=\"[link:newsletter_view_in_browser_url]\">View in browser link</a> <a data-post-id=\"10\" href=\"http://example.com\">Post link</a> Hello [subscriber:firstname | default:test] <a href=\"[link:subscription_unsubscribe_url]\">Unsubscribe link</a> <a href=\"[link:subscription_manage_url]\">Manage subscription link</a>"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
Reference in New Issue
Block a user