Skip to content

When an order is fully paid

Sends a notification when a Commerce Order becomes fully paid. Fires when the outstanding balance reaches zero.

If an order is refunded, and returns to zero once again, another notification will be triggered.

Requires Craft Commerce

Only available when the Craft Commerce plugin is installed.

Field Conditions

Field conditions restrict the notification based on the element's content, using Craft's native conditions framework. Build a rule set against the element's attributes and field values, and the notification will be sent only when every rule matches.

Must match all conditions

The condition builder evaluates every rule with AND semantics, so each rule must pass for the notification to be sent.

The "has changed" operator

Field rules now include an additional "has changed" operator, alongside the existing standard options.

When the element is saved, the "has changed" operator checks whether the field's value has changed during the save, (regardless of what the new value is). The notification will only be sent when the specified field's value has changed.

Twig variables

The object variable (and its order alias) is the paid Order.

twig
Order {{ order.shortNumber }} is fully paid.
Amount paid: {{ order.totalPaid|currency }}

Caveats

Refunds and re-payments

If an order is later refunded and then paid again, this trigger will fire a second time. Each transition into the fully-paid state is treated as a separate notification opportunity.

To send a notification only on the initial completion of the order, use "When an order is completed (placed)" instead.

Notifying the customer

To notify the customer of an Order, use Dynamic Recipients and pass the order's email address into {% setRecipients %}:

twig
{% if order.email %}
    {% setRecipients order.email %}
{% endif %}

If the customer is a Craft user, you can instead pass the User object to get more data from the recipient variable:

twig
{% if order.customer %}
    {% setRecipients order.customer %}
{% endif %}

Examples

Payment confirmation for the customer

twig
Thanks, {{ order.billingAddress.firstName }}!

Your payment of {{ order.totalPaid|currency }} for order {{ order.shortNumber }} has been received.

Internal alert for fulfillment

twig
Order {{ order.shortNumber }} is fully paid and ready to ship.

- Customer: {{ order.email }}
- Total: {{ order.totalPaid|currency }}
- Items: {{ order.totalQty }}

Skip the message on a re-payment after a refund

twig
{% if order.dateOrdered != order.datePaid %}
    {% skipMessage "Payment is a re-payment after a refund." %}
{% endif %}

Order {{ order.shortNumber }} is paid in full.