Skip to content

Email Notifications API

Configure email notification templates, manage scheduling reminders, preview templates, and update notification settings.

Base URL: https://your-site.com/wp-json/fluent-cart/v2/email-notification

Policy: StoreSensitivePolicy — Requires store/sensitive capability.


List All Notifications

GET /fluent-cart/v2/email-notification

Retrieve all registered email notification templates with their current configuration. Returns both default and customized notification settings for orders, subscriptions, and scheduler/reminder actions.

Parameters

No parameters required.

Response

json
{
  "data": {
    "order_paid_admin": {
      "event": "order_paid_done",
      "group": "order",
      "group_label": "Order Actions",
      "title": "Send mail to admin after New Order Paid",
      "description": "This email will be sent to the admin after an order is placed.",
      "recipient": "admin",
      "smartcode_groups": [],
      "template_path": "order.paid.admin",
      "is_async": false,
      "pre_header": "You got a new order on your shop...",
      "name": "order_paid_admin",
      "settings": {
        "active": "yes",
        "subject": "New Sales On {{settings.store_name}}",
        "is_default_body": "yes",
        "email_body": ""
      }
    },
    "order_paid_customer": {
      "event": "order_paid",
      "group": "order",
      "group_label": "Order Actions",
      "title": "Purchase receipt to customer",
      "description": "This email will be sent to the customer after an order is placed.",
      "recipient": "customer",
      "smartcode_groups": [],
      "template_path": "order.paid.customer",
      "is_async": false,
      "name": "order_paid_customer",
      "settings": {
        "active": "yes",
        "subject": "Purchase Receipt #{{order.invoice_no}}",
        "is_default_body": "yes",
        "email_body": ""
      }
    }
  }
}

Available Notifications

The following notification keys are returned, organized by group:

Order Actions (order group)

KeyEventRecipientDescription
order_paid_adminorder_paid_doneadminNew order paid notification to admin
order_paid_customerorder_paidcustomerPurchase receipt to customer
order_refunded_adminorder_refundedadminRefund notification to admin
order_refunded_customerorder_refundedcustomerRefund confirmation to customer
order_shipped_customershipping_status_changed_to_shippedcustomerShipping notification to customer
order_delivered_customershipping_status_changed_to_deliveredcustomerDelivery notification to customer
order_placed_adminorder_placed_offlineadminOffline payment order to admin
order_placed_customerorder_placed_offlinecustomerOffline payment confirmation to customer

Subscription Actions (subscription group)

KeyEventRecipientDescription
subscription_renewal_customersubscription_renewedcustomerRenewal confirmation to customer
subscription_renewal_adminsubscription_renewedadminRenewal notification to admin
subscription_canceled_customersubscription_canceledcustomerCancellation notice to customer
subscription_canceled_adminsubscription_canceledadminCancellation notice to admin

Scheduler / Reminder Actions (scheduler group)

KeyEventRecipientDescription
invoice_reminder_overdue_customerinvoice_reminder_overduecustomerPayment reminder to customer
invoice_reminder_overdue_admininvoice_reminder_overdueadminPayment reminder copy to admin
subscription_renewal_reminder_customersubscription_renewal_remindercustomerUpcoming renewal reminder to customer
subscription_renewal_reminder_adminsubscription_renewal_reminderadminUpcoming renewal reminder copy to admin
subscription_trial_end_reminder_customersubscription_trial_end_remindercustomerTrial ending soon reminder to customer
subscription_trial_end_reminder_adminsubscription_trial_end_reminderadminTrial ending soon reminder copy to admin

Example

bash
curl -X GET "https://example.com/wp-json/fluent-cart/v2/email-notification" \
  -u "username:app_password"

Get Single Notification

GET /fluent-cart/v2/email-notification/{notification}

Retrieve a single email notification template by its name, along with available shortcodes for the email editor.

Parameters

ParameterTypeLocationRequiredDescription
notificationstringpathYesThe notification key (e.g., order_paid_customer, subscription_renewal_admin)

Response

json
{
  "data": {
    "event": "order_paid",
    "group": "order",
    "group_label": "Order Actions",
    "title": "Purchase receipt to customer",
    "description": "This email will be sent to the customer after an order is placed.",
    "recipient": "customer",
    "smartcode_groups": [],
    "template_path": "order.paid.customer",
    "is_async": false,
    "name": "order_paid_customer",
    "settings": {
      "active": "yes",
      "subject": "Purchase Receipt #{{order.invoice_no}}",
      "is_default_body": "yes",
      "email_body": ""
    }
  },
  "shortcodes": {
    "order": {
      "title": "Order",
      "key": "order",
      "shortcodes": {
        "{{order.id}}": "Order ID",
        "{{order.invoice_no}}": "Order Number",
        "{{order.status}}": "Order Status",
        "{{order.total_amount_formatted}}": "Order Total Amount (Formatted)"
      }
    },
    "general": {
      "title": "General",
      "key": "wp",
      "shortcodes": {
        "{{wp.admin_email}}": "Admin Email",
        "{{wp.site_url}}": "Site URL",
        "{{wp.site_title}}": "Site Title"
      }
    },
    "customer": {
      "title": "Customer",
      "key": "customer",
      "shortcodes": {
        "{{order.billing.first_name}}": "First Name",
        "{{order.billing.last_name}}": "Last Name",
        "{{order.billing.email}}": "Email"
      }
    },
    "transaction": {
      "title": "transaction",
      "key": "settings",
      "shortcodes": {
        "{{transaction.total_formatted}}": "Total Amount (Formatted)",
        "{{transaction.payment_method}}": "Payment Method",
        "{{transaction.status}}": "Status"
      }
    },
    "settings": {
      "title": "Settings",
      "key": "settings",
      "shortcodes": {
        "{{settings.store_name}}": "Store Name",
        "{{settings.store_logo}}": "Store Logo"
      }
    },
    "license": {
      "title": "License (Loop)",
      "key": "license",
      "shortcodes": {
        "{{license.key}}": "License Key",
        "{{license.status}}": "Status"
      }
    }
  }
}

Error Response

Returned when the notification key is not found:

json
{
  "message": "Notification Details not found"
}

Example

bash
curl -X GET "https://example.com/wp-json/fluent-cart/v2/email-notification/order_paid_customer" \
  -u "username:app_password"

Update Notification

PUT /fluent-cart/v2/email-notification/{notification}

Update an email notification template's settings including subject, body content, and active status.

Parameters

ParameterTypeLocationRequiredDescription
notificationstringpathYesThe notification key (e.g., order_paid_customer)
settings.subjectstringbodyYesEmail subject line (max 255 characters). Supports shortcodes like {{order.invoice_no}}
settings.email_bodystringbodyNoCustom email body content (HTML). Sanitized with wp_kses_post
settings.activestringbodyNoEnable or disable the notification: yes or no
settings.is_default_bodystringbodyNoWhether to use the default template body: yes or no. When set to yes, the custom email_body is cleared

Validation Rules

FieldRules
settings.subjectRequired, sanitized text, max 255 characters
settings.email_bodyNullable, string, sanitized with wp_kses_post
settings.activeNullable, sanitized text
settings.is_default_bodyNullable, sanitized text

Response

json
{
  "message": "Notification updated successfully"
}

Error Response

json
{
  "message": "Failed to update notification"
}

Example

bash
curl -X PUT "https://example.com/wp-json/fluent-cart/v2/email-notification/order_paid_customer" \
  -u "username:app_password" \
  -H "Content-Type: application/json" \
  -d '{
    "settings": {
      "subject": "Your Order #{{order.invoice_no}} is Confirmed!",
      "email_body": "<p>Thank you for your purchase, {{order.billing.first_name}}!</p>",
      "active": "yes",
      "is_default_body": "no"
    }
  }'

Enable/Disable Notification

POST /fluent-cart/v2/email-notification/enable-notification/{name}

Toggle a notification template on or off without modifying other settings.

Parameters

ParameterTypeLocationRequiredDescription
namestringpathYesThe notification key (e.g., order_paid_admin)
activestringbodyYesSet to yes to enable or no to disable the notification

Response

json
{
  "message": "Notification updated successfully"
}

Error Response

json
{
  "message": "Failed to update notification"
}

Example

bash
curl -X POST "https://example.com/wp-json/fluent-cart/v2/email-notification/enable-notification/order_refunded_admin" \
  -u "username:app_password" \
  -H "Content-Type: application/json" \
  -d '{
    "active": "yes"
  }'

Get Shortcodes

GET /fluent-cart/v2/email-notification/get-short-codes

Retrieve available shortcodes, email template files, and editor buttons for the email notification editor.

Parameters

No parameters required.

Response

json
{
  "data": {
    "email_templates": [
      {
        "path": "fluent_cart_order_paid",
        "label": "Order Paid"
      },
      {
        "path": "fluent_cart_subscription_renewal",
        "label": "Subscription Renewal"
      }
    ],
    "shortcodes": {
      "order": {
        "title": "Order",
        "key": "order",
        "shortcodes": {
          "{{order.id}}": "Order ID",
          "{{order.customer_dashboard_link}}": "Customer Dashboard Link",
          "{{order.status}}": "Order Status",
          "{{order.invoice_no}}": "Order Number",
          "{{order.total_amount_formatted}}": "Order Total Amount (Formatted)",
          "{{order.created_at}}": "Order Create Date"
        }
      },
      "general": {
        "title": "General",
        "key": "wp",
        "shortcodes": {
          "{{wp.admin_email}}": "Admin Email",
          "{{wp.site_url}}": "Site URL",
          "{{wp.site_title}}": "Site Title",
          "{{user.display_name}}": "User Display Name",
          "{{user.user_email}}": "User Email"
        }
      },
      "customer": {
        "title": "Customer",
        "key": "customer",
        "shortcodes": {
          "{{order.billing.first_name}}": "First Name",
          "{{order.billing.last_name}}": "Last Name",
          "{{order.billing.email}}": "Email",
          "{{order.billing.city}}": "City",
          "{{order.billing.state}}": "State",
          "{{order.billing.country}}": "Country"
        }
      },
      "transaction": {
        "title": "transaction",
        "key": "settings",
        "shortcodes": {
          "{{transaction.total}}": "Total Amount",
          "{{transaction.total_formatted}}": "Total Amount (Formatted)",
          "{{transaction.refund_amount}}": "Refund Amount",
          "{{transaction.refund_amount_formatted}}": "Refund Amount (Formatted)",
          "{{transaction.payment_method}}": "Payment Method",
          "{{transaction.card_last_4}}": "Card Last 4",
          "{{transaction.card_brand}}": "Card Brand",
          "{{transaction.status}}": "Status",
          "{{transaction.currency}}": "Currency"
        }
      },
      "settings": {
        "title": "Settings",
        "key": "settings",
        "shortcodes": {
          "{{settings.store_name}}": "Store Name",
          "{{settings.store_logo}}": "Store Logo",
          "{{settings.store_address}}": "Store Address Line 1",
          "{{settings.store_address2}}": "Store Address Line 2",
          "{{settings.store_country}}": "Store Country",
          "{{settings.store_state}}": "Store State",
          "{{settings.store_city}}": "Store City",
          "{{settings.store_postcode}}": "Store Postcode"
        }
      },
      "license": {
        "title": "License (Loop)",
        "key": "license",
        "shortcodes": {
          "{{license.sl}}": "Serial Number",
          "{{license.key}}": "License Key",
          "{{license.status}}": "Status",
          "{{license.product_name}}": "Product Name",
          "{{license.variant}}": "Variant",
          "{{license.limit}}": "Activation Limit",
          "{{license.activation_count}}": "Activation Count",
          "{{license.expiration_date}}": "Expiration Date"
        }
      }
    },
    "buttons": {
      "View Order": "<a href=\"https://example.com/wp-admin/admin.php?page=fluent-cart#/orders/{{order.id}}/view\" style=\"background-color: green; color: #fff; padding: 10px 20px; text-decoration: none; border-radius: 5px;\">View Order</a>"
    }
  }
}

Example

bash
curl -X GET "https://example.com/wp-json/fluent-cart/v2/email-notification/get-short-codes" \
  -u "username:app_password"

Get Global Email Settings

GET /fluent-cart/v2/email-notification/get-settings

Retrieve the global email configuration settings used across all notification emails (sender name, email addresses, footer, etc.).

Parameters

No parameters required.

Response

json
{
  "data": {
    "from_name": "My Store",
    "from_email": "[email protected]",
    "reply_to_name": "",
    "reply_to_email": "",
    "email_footer": "<p>Thank you for shopping with us!</p>",
    "show_email_footer": "yes",
    "admin_email": "{{wp.admin_email}}",
    "notification_config": {}
  },
  "shortcodes": [
    {
      "title": "General",
      "key": "wp",
      "shortcodes": {
        "{{wp.admin_email}}": "Admin Email",
        "{{wp.site_url}}": "Site URL",
        "{{wp.site_title}}": "Site Title",
        "{{user.display_name}}": "User Display Name",
        "{{user.user_email}}": "User Email"
      }
    },
    {
      "title": "Settings",
      "key": "settings",
      "shortcodes": {
        "{{settings.store_name}}": "Store Name",
        "{{settings.store_logo}}": "Store Logo",
        "{{settings.store_address}}": "Store Address Line 1"
      }
    }
  ]
}

Example

bash
curl -X GET "https://example.com/wp-json/fluent-cart/v2/email-notification/get-settings" \
  -u "username:app_password"

Save Global Email Settings

POST /fluent-cart/v2/email-notification/save-settings

Update the global email configuration settings for all notification emails.

Parameters

ParameterTypeLocationRequiredDescription
from_namestringbodyYesSender name displayed in emails (max 255 characters)
from_emailstringbodyYesSender email address (must be valid email, max 255 characters)
reply_to_namestringbodyNoReply-to name (max 255 characters)
reply_to_emailstringbodyNoReply-to email address (must be valid email, max 255 characters)
email_footerstringbodyNoHTML content for the email footer. Sanitized with wp_kses_post
admin_emailstringbodyYesAdmin notification recipient email(s). Supports shortcodes like {{wp.admin_email}}
show_email_footerstringbodyNoShow or hide the email footer: yes or no. Note: On free plans, this is always forced to yes

Validation Rules

FieldRules
from_nameRequired, sanitized text, max 255 characters
from_emailRequired, valid email, max 255 characters
reply_to_nameNullable, sanitized text, max 255 characters
reply_to_emailNullable, valid email, max 255 characters
email_footerNullable, string, sanitized with wp_kses_post
admin_emailRequired, string
show_email_footerNullable, string

Response

json
{
  "message": "Email settings saved successfully"
}

Error Response

json
{
  "message": "Failed to save email settings"
}

Example

bash
curl -X POST "https://example.com/wp-json/fluent-cart/v2/email-notification/save-settings" \
  -u "username:app_password" \
  -H "Content-Type: application/json" \
  -d '{
    "from_name": "My Store",
    "from_email": "[email protected]",
    "reply_to_name": "Support",
    "reply_to_email": "[email protected]",
    "email_footer": "<p>Thank you for shopping with us!</p>",
    "admin_email": "[email protected]",
    "show_email_footer": "yes"
  }'

Get Scheduling Settings

GET /fluent-cart/v2/email-notification/reminders

Retrieve reminder/scheduling settings for automated email notifications such as payment reminders, renewal reminders, and trial-end reminders. Returns both the current settings and the form field definitions for the reminders tab.

Parameters

No parameters required.

Response

json
{
  "settings": {
    "reminders_enabled": "yes",
    "invoice_reminders_enabled": "yes",
    "invoice_reminder_due_days": 3,
    "invoice_reminder_overdue_days": "1,3,7",
    "yearly_renewal_reminders_enabled": "yes",
    "yearly_renewal_reminder_days": 30,
    "trial_end_reminders_enabled": "yes",
    "trial_end_reminder_days": 3,
    "monthly_renewal_reminders_enabled": "no",
    "monthly_renewal_reminder_days": 7,
    "quarterly_renewal_reminders_enabled": "no",
    "quarterly_renewal_reminder_days": 14,
    "half_yearly_renewal_reminders_enabled": "no",
    "half_yearly_renewal_reminder_days": 14
  },
  "fields": {
    "reminders": { }
  }
}

Example

bash
curl -X GET "https://example.com/wp-json/fluent-cart/v2/email-notification/reminders" \
  -u "username:app_password"

Save Scheduling Settings

POST /fluent-cart/v2/email-notification/reminders

Update reminder/scheduling settings for automated email notifications. Each reminder type has an enable toggle and a days configuration that controls how many days before the event the reminder is sent.

Parameters

ParameterTypeLocationRequiredDescription
reminders_enabledstringbodyNoMaster toggle for all reminders: yes or no
invoice_reminders_enabledstringbodyNoEnable invoice payment reminders: yes or no
invoice_reminder_due_daysintegerbodyNoDays before due date to send invoice reminder (0-365). Required when invoice_reminders_enabled is yes
invoice_reminder_overdue_daysstringbodyNoComma-separated day intervals for overdue reminders (e.g., 1,3,7)
yearly_renewal_reminders_enabledstringbodyNoEnable yearly subscription renewal reminders: yes or no
yearly_renewal_reminder_daysintegerbodyNoDays before renewal to send reminder (7-90). Required when yearly_renewal_reminders_enabled is yes
trial_end_reminders_enabledstringbodyNoEnable trial ending reminders: yes or no
trial_end_reminder_daysintegerbodyNoDays before trial ends to send reminder (1-14). Required when trial_end_reminders_enabled is yes
monthly_renewal_reminders_enabledstringbodyNoEnable monthly renewal reminders: yes or no
monthly_renewal_reminder_daysintegerbodyNoDays before renewal to send reminder (3-28). Required when monthly_renewal_reminders_enabled is yes
quarterly_renewal_reminders_enabledstringbodyNoEnable quarterly renewal reminders: yes or no
quarterly_renewal_reminder_daysintegerbodyNoDays before renewal to send reminder (7-60). Required when quarterly_renewal_reminders_enabled is yes
half_yearly_renewal_reminders_enabledstringbodyNoEnable half-yearly renewal reminders: yes or no
half_yearly_renewal_reminder_daysintegerbodyNoDays before renewal to send reminder (7-60). Required when half_yearly_renewal_reminders_enabled is yes

Validation Rules

Validation for the days fields is conditional -- rules are only enforced when the corresponding toggle is set to yes:

Toggle FieldDays FieldRules (when enabled)
invoice_reminders_enabledinvoice_reminder_due_daysInteger, min: 0, max: 365
yearly_renewal_reminders_enabledyearly_renewal_reminder_daysInteger, min: 7, max: 90
trial_end_reminders_enabledtrial_end_reminder_daysInteger, min: 1, max: 14
monthly_renewal_reminders_enabledmonthly_renewal_reminder_daysInteger, min: 3, max: 28
quarterly_renewal_reminders_enabledquarterly_renewal_reminder_daysInteger, min: 7, max: 60
half_yearly_renewal_reminders_enabledhalf_yearly_renewal_reminder_daysInteger, min: 7, max: 60

Response

json
{
  "data": { },
  "message": "Scheduling settings saved successfully"
}

Error Response

json
{
  "message": "Failed to save scheduling settings"
}

Example

bash
curl -X POST "https://example.com/wp-json/fluent-cart/v2/email-notification/reminders" \
  -u "username:app_password" \
  -H "Content-Type: application/json" \
  -d '{
    "reminders_enabled": "yes",
    "invoice_reminders_enabled": "yes",
    "invoice_reminder_due_days": 3,
    "invoice_reminder_overdue_days": "1,3,7",
    "yearly_renewal_reminders_enabled": "yes",
    "yearly_renewal_reminder_days": 30,
    "trial_end_reminders_enabled": "yes",
    "trial_end_reminder_days": 3,
    "monthly_renewal_reminders_enabled": "no",
    "monthly_renewal_reminder_days": 7,
    "quarterly_renewal_reminders_enabled": "no",
    "quarterly_renewal_reminder_days": 14,
    "half_yearly_renewal_reminders_enabled": "no",
    "half_yearly_renewal_reminder_days": 14
  }'

Preview Notification

POST /fluent-cart/v2/email-notification/preview

Generate an HTML preview of a custom email notification template. Uses the block editor email body from the notification's saved settings, parses it through the block parser, wraps it in the email template layout, and resolves shortcodes using real or fallback order data.

Parameters

ParameterTypeLocationRequiredDescription
notification_namestringbodyYesThe notification key to preview (e.g., order_paid_customer)
order_idintegerbodyNoSpecific order ID to use for shortcode data. If not provided or not found, the most recent order is used

Response

json
{
  "html": "<!DOCTYPE html><html>...rendered email HTML...</html>"
}

The html field contains the fully rendered email including:

  • The parsed block editor content
  • Email header and footer
  • Resolved shortcodes (order data, customer info, store settings)

Error Response

When no notification name is provided:

json
{
  "message": "No notification name provided."
}

When the notification key is not found:

json
{
  "message": "Notification not found."
}

Example

bash
curl -X POST "https://example.com/wp-json/fluent-cart/v2/email-notification/preview" \
  -u "username:app_password" \
  -H "Content-Type: application/json" \
  -d '{
    "notification_name": "order_paid_customer",
    "order_id": 42
  }'

Preview Default Template

POST /fluent-cart/v2/email-notification/preview-default-template

Generate an HTML preview of a default (built-in) email template. Unlike the custom block editor preview, this renders the PHP-based default template using dummy preview data, wrapped in the standard email layout with header and footer.

Parameters

ParameterTypeLocationRequiredDescription
templatestringbodyYesThe template path name to preview (e.g., order.paid.customer, subscription.renewal.admin). Corresponds to the template_path value from the notification configuration

Available Template Paths

Template PathDescription
order.paid.adminAdmin notification for paid order
order.paid.customerCustomer receipt for paid order
order.refunded.adminAdmin notification for refund
order.refunded.customerCustomer refund confirmation
order.shipped.customerCustomer shipping notification
order.delivered.customerCustomer delivery notification
order.placed.adminAdmin notification for offline payment order
order.placed.customerCustomer confirmation for offline payment order
order.reminder.overdue.customerCustomer payment reminder
order.reminder.overdue.adminAdmin copy of payment reminder
subscription.renewal.customerCustomer renewal confirmation
subscription.renewal.adminAdmin renewal notification
subscription.canceled.customerCustomer cancellation notice
subscription.canceled.adminAdmin cancellation notice
subscription.reminder.customerCustomer renewal reminder
subscription.reminder.adminAdmin copy of renewal reminder
subscription.trial_end.customerCustomer trial ending reminder
subscription.trial_end.adminAdmin copy of trial ending reminder

Response

json
{
  "data": {
    "content": "<!DOCTYPE html><html>...rendered email HTML...</html>"
  }
}

The content field contains the fully rendered email HTML with:

  • The default PHP template rendered with dummy preview data
  • Email header and footer
  • Resolved shortcodes
  • All links and buttons disabled (not clickable) via injected CSS

Example

bash
curl -X POST "https://example.com/wp-json/fluent-cart/v2/email-notification/preview-default-template" \
  -u "username:app_password" \
  -H "Content-Type: application/json" \
  -d '{
    "template": "order.paid.customer"
  }'

Notification Object Reference

Each notification object contains the following properties:

PropertyTypeDescription
namestringUnique notification key identifier
eventstringThe event hook that triggers this notification
groupstringGrouping category: order, subscription, or scheduler
group_labelstringHuman-readable group label
titlestringDescriptive title of the notification
descriptionstringExplanation of when this notification is sent
recipientstringTarget recipient: admin or customer
smartcode_groupsarrayAdditional shortcode groups (extensible via filters)
template_pathstringDot-notation path to the default PHP email template
is_asyncbooleanWhether the email is sent asynchronously
pre_headerstringEmail pre-header text (admin notifications only)
manage_togglestringIf set to no, the notification cannot be toggled off (e.g., offline payment confirmations)
settingsobjectNotification settings (see below)

Notification Settings Object

PropertyTypeDescription
activestringWhether the notification is enabled: yes or no
subjectstringEmail subject line. Supports shortcodes
is_default_bodystringWhether to use the built-in PHP template: yes or no
email_bodystringCustom email body content (HTML). Empty when using default body

FluentCart developer documentation