Skip to content

Commit

Permalink
Add unsubscribe template in waitlist email templates
Browse files Browse the repository at this point in the history
  • Loading branch information
dpanta94 committed Feb 12, 2025
1 parent 3686815 commit 1f0d11e
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/views/emails/confirmation.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,6 @@

$this->template( 'template-parts/body/additional-content' );

$this->template( 'template-parts/body/unsubscribe' );

$this->template( 'template-parts/footer' );
2 changes: 2 additions & 0 deletions src/views/emails/spot-available.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,6 @@

$this->template( 'template-parts/body/additional-content' );

$this->template( 'template-parts/body/unsubscribe' );

$this->template( 'template-parts/footer' );
43 changes: 43 additions & 0 deletions src/views/emails/template-parts/body/unsubscribe.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php
/**
* Event Tickets Plus Emails: Main template > Body > Unsubscribe.
*
* Override this template in your own theme by creating a file at:
* [your-theme]/tribe/tickets/emails/template-parts/body/unsubscribe.php
*
* See more documentation about our views templating system.
*
* @link https://evnt.is/tickets-emails-tpl Help article for Tickets Emails template files.
*
* @version TBD
*
* @since TBD
*
* @var Subscriber $subscriber The post object with properties.
*/

use TEC\Tickets_Plus\Waitlist\Subscriber;

if ( empty( $subscriber ) ) {
return;
}

if ( ! $subscriber instanceof Subscriber ) {
return;
}

?>
<tr>
<td class="tec-tickets__email-table-content-post-title-container">
<p>
<?php
printf(
// translators: 1 is opening a tag and 2 is closing a tag.
esc_html_x( 'To unsubscribe %1$sclick here%2$s', 'Unsubscribe link in waitlist emails', 'event-tickets' ),
'<a href="' . esc_url( $subscriber->get_unsubscribe_url() ) . '" target="_blank" rel="noopener noreferrer">',
'</a>'
);
?>
</p>
</td>
</tr>

0 comments on commit 1f0d11e

Please sign in to comment.