Troubleshooting · Developer docs

Troubleshooting

Grouped by symptom, never by module, because the person with the problem does not know which module has it. One hundred questions across ten pages, each answered with the causes in the order they usually turn out to be true.

Answer Commerce

The order confirmation email did not send

The platform sends no order email of its own. A receipt, a shipping notice and a refund notice are each a job with a Send mail action (transactional emails). So, in order:

  1. No job was built. The invoice's Send receipt event is not a purchase receipt: it fires only when an administrator presses that button.
  2. The job did not fire. A receipt job is on Orders, CreateRecord: not on the checkout, which is deleted when the order is created, and not on the invoice. Look in Batch Logs for a batch at the time of the order. No batch means the job never started: it is unpublished, limited to another site, or on the wrong event (my job did not fire).
  3. The batch failed at Send mail. An invalid recipient address fails the action, and so does an error in the email template. The batch log shows the message, provided the job's batch persistence keeps errors.
  4. The recipient expression is wrong. A job's record is an API model, and the shopper's address is on the order's person:
Template code
{$event->getRecord()->getPerson()->getEmail()}
{{ event.getRecord().getPerson().getEmail() }}
  1. It was sent to the development address. On any environment other than production, mail goes to the development address unless the recipient matches its whitelist.
  2. It was sent and filtered as spam. Send from an address on the client's own domain, authenticated with SPF and DKIM.

Building one from the start: send an email when a record is created.

More in Commerce

  1. The cart empties between pages
  2. The cart count is wrong or stale
  3. A discount code is rejected for no visible reason
  4. Shipping rates do not appear at checkout
  5. Tax is calculated as zero

Was this page helpful?

Your answer goes to the docs team.