Email Templates

The notification email is fully customizable. This page explains the template system, available tags, and provides ready-to-use examples.


How templates work

↑ Back to top

The notification email is a native WooCommerce email, configured at WooCommerce → Settings → Emails → Payment Token Expiry. That screen has the standard WooCommerce email fields (Subject, Email heading, HTML/plain-text type, recipient), plus a Message field added by this plugin for the body text.

The Message field accepts plain text (with basic HTML allowed) and template tags. When an email is sent, the plugin:

  1. Replaces each {tag} with the real value for that customer and card.
  2. Wraps the result in your WooCommerce email template (header, logo, footer).

This means you write only the body — WooCommerce handles the branding.

A shortcut to this screen is also available on the plugin’s own Settings → Token Expiry page, under Email Settings.


Template tags

↑ Back to top
TagExample outputDescription
{customer_name}Jane SmithCustomer’s display name
{customer_first_name}JaneCustomer’s first name only
{customer_last_name}SmithCustomer’s last name only
{customer_email}jane@example.comCustomer’s email address
{card_type}VisaCard brand (Visa, Mastercard, Amex, etc.)
{card_last4}4242Last 4 digits of the card number
{expiry_date}06/2026Full expiry date as MM/YYYY
{expiry_month}06Expiry month as MM
{expiry_year}2026Expiry year as YYYY
{my_account_url}https://example.com/my-account/Link to the customer’s My Account page
{payment_methods_url}https://example.com/my-account/payment-methods/Direct link to Payment Methods management
{site_name}My StoreWordPress site name
{site_url}https://example.comWordPress site URL

Default template

↑ Back to top

The built-in template is a clean, functional plain-text message. Leave the Message field blank to use it — the default text is shown as placeholder text in the field, and clearing your customization at any time restores it.

Hello {customer_name},

Your saved {card_type} card ending in {card_last4} will expire soon ({expiry_date}).

Please update your payment information to avoid any interruption to your service.

You can update your payment method in your account:
{payment_methods_url}

Thank you for your continued business.

Example templates

↑ Back to top

Friendly / brand-voice template

↑ Back to top
Hi {customer_first_name},

Just a quick heads-up — your {card_type} card ending in {card_last4} expires in {expiry_month}/{expiry_year}.

To make sure your orders and subscriptions keep running without a hitch, add your new card details here:

👉 {payment_methods_url}

It only takes a minute, and you'll be all set.

Thanks for being a {site_name} customer!
The {site_name} Team

Subscription-focused template

↑ Back to top
Hello {customer_name},

We noticed that the payment card linked to your subscription — {card_type} ending in {card_last4} — is set to expire on {expiry_date}.

If you have an active subscription with us, an expired card will cause your next renewal to fail, which may interrupt your service.

To keep everything running smoothly, please update your card before {expiry_date}:
{payment_methods_url}

If you have already updated your payment method, you can ignore this message.

Questions? Reply to this email or visit {my_account_url}.

— The {site_name} Team

Minimal / transactional template

↑ Back to top
{card_type} •••• {card_last4} expires {expiry_date}.

Update now: {payment_methods_url}

HTML in templates

↑ Back to top

The plugin wraps your template in WooCommerce’s HTML email layout automatically. If you want to add basic formatting inside the body, you can use standard HTML:

<p>Hi {customer_first_name},</p>

<p>Your <strong>{card_type}</strong> card ending in <strong>{card_last4}</strong> expires on <strong>{expiry_date}</strong>.</p>

<p>
  <a href="{payment_methods_url}" style="background:#7f54b3;color:#fff;padding:10px 20px;text-decoration:none;border-radius:4px;">
    Update payment method
  </a>
</p>

<p>Thank you,<br>{site_name}</p>

Note: The WooCommerce email wrapper uses inline CSS. For maximum compatibility across email clients, keep your custom HTML simple and avoid external stylesheets.


Email subject and heading

↑ Back to top

The Subject and Email heading fields (on the WooCommerce → Settings → Emails → Payment Token Expiry screen) support the same template tags as the message body. Recommended subject pattern:

Action needed: your {card_type} card ending in {card_last4} expires {expiry_date}

Keep the subject under 60 characters to prevent truncation in Gmail, Outlook, and Apple Mail. The heading appears as the large title inside the email body, above your message.


Testing your template

↑ Back to top

After saving your changes, go to Settings → Token Expiry → Email Settings and click Send test email. The plugin sends a preview email to your account’s email address using sample card data. Always test before going live with a new template.

Use of your personal data
We and our partners process your personal data (such as browsing data, IP Addresses, cookie information, and other unique identifiers) based on your consent and/or our legitimate interest to optimize our website, marketing activities, and your user experience.