Everyone

Automatic Payment Reminders

The three automated billing emails Commerce sends throughout the invoice lifecycle and how to customise them.

Last updated 1776211200

Overview

Commerce sends three automated emails related to billing. These are event-driven — triggered by state changes, not by a configurable reminder schedule. There is no "send reminder 3 days before due date" timer; instead, the renewal invoice itself serves as the advance notification.

Email Trigger Sent by
Invoice Created New invoice generated (order or renewal) Immediately on invoice creation
Overdue Reminder Invoice moves to overdue commerce:mark-overdue-invoices command
Service Suspended Service suspended for non-payment commerce:check-overdue-services command

Invoice Created Email

Sent when: A new invoice is generated — either from a new order placed by the client, or by the commerce:generate-renewal-invoices scheduler.

Contains:

  • Invoice number
  • Amount due and currency
  • Due date
  • A direct link to the payment page in the client portal

For recurring services, this email is the client's advance notice that their next payment is due. With the default renewal window of 7 days, clients receive this email 7 days before their service's next_due_date.

[!TIP] If you want more advance notice, increase the renewal window in Admin → Settings → Billing → Renewal Window (days). Setting it to 14 means clients receive the invoice 14 days before expiry.

Overdue Reminder Email

Sent when: The commerce:mark-overdue-invoices command marks an invoice as overdue.

Contains:

  • Invoice number and amount
  • How many days overdue the invoice is
  • A payment link
  • A warning about service suspension (if grace period is configured)

Sent exactly once. The command records the send time in the notified_at column on the invoice. On subsequent runs (e.g. the next day), the invoice is already overdue and notified_at is already set — the email is not sent again.

[!IMPORTANT] Commerce does not send escalating overdue reminders (day 1, day 3, day 7, etc.) in the current release. One overdue reminder is sent when the invoice first becomes overdue. If you need escalating reminders, you can build a custom command that checks overdue invoices without a notified_at older than X days.

Service Suspended Email

Sent when: A service is suspended by commerce:check-overdue-services because the grace period has elapsed.

Contains:

  • Which service was suspended
  • The overdue invoice number and amount
  • A payment link (paying the invoice reactivates the service automatically)
  • Contact information for support

Customising Email Templates

All three templates are editable at Admin → Email Templates. Look for:

  • billing.invoice_created
  • billing.invoice_overdue
  • billing.service_suspended

Templates use Blade syntax. Available variables are documented in the template editor's sidebar. You can include the client's name, invoice details, due date, gateway link, and company name.

[!WARNING] If an email template is missing or has a rendering error, Commerce silently skips sending that email rather than throwing an exception. After editing a template, send a test using the Preview button in the template editor to confirm it renders correctly.

Testing Emails

To test the overdue reminder without waiting for real invoices to go overdue:

php artisan commerce:mark-overdue-invoices --dry-run

This logs which invoices would be marked overdue and which emails would be sent, without making any changes.

To preview an email template as a specific client would see it:

Go to Admin → Email Templates → [template] → Preview and select a client.

SMTP Configuration

All Commerce emails are sent through Laravel's mail system. Configure your mail driver in Admin → Settings → Email (or in .env for server-level config):

MAIL_MAILER=smtp
MAIL_HOST=mail.yourdomain.com
MAIL_PORT=587
MAIL_USERNAME=billing@yourdomain.com
MAIL_PASSWORD=secret
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=billing@yourdomain.com
MAIL_FROM_NAME="Your Company Billing"

Related Topics