Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1007,6 +1007,7 @@ public function get_sync_payload( $post ) {
'settings' => [
'subject_line' => html_entity_decode( $post->post_title ),
'title' => $this->get_campaign_name( $post ),
'auto_footer' => false,
],
];

Expand Down Expand Up @@ -1097,6 +1098,21 @@ public function get_sync_payload( $post ) {
return $payload;
}

/**
* Get the campaign footer HTML.
*
* @return string Campaign footer HTML.
*/
public function get_campaign_footer() {
return '
<p>
<strong>*|LIST:COMPANY|*</strong> — *|HTML:LIST_ADDRESS_HTML|*
<br />
<a href="*|UPDATE_PROFILE|*">Update your preferences</a> — <a href="*|UNSUB|*">Unsubscribe from all *|LIST:COMPANY|* newsletters</a>
*|IF:REWARDS|* <br /> *|HTML:REWARDS|* *|END:IF|*
</p>';
}

/**
* Synchronize post with corresponding ESP campaign.
*
Expand Down Expand Up @@ -1157,7 +1173,7 @@ public function sync( $post ) {

$renderer = new Newspack_Newsletters_Renderer();
$content_payload = [
'html' => $renderer->retrieve_email_html( $post ),
'html' => $renderer->retrieve_email_html( $post ) . $this->get_campaign_footer(),
];

$content_result = $this->validate(
Expand Down