When order is placed an emails is sent to the user generated with template commerce-order-receipt--default.html.twig

When order is shipped another email is sent to the user, now generated with template file commerce-shipment-notification.html.twig

How to detect from those 2 files if it's a first order (generated by user action) or it was recurring order (generated automatically, by cron)?

I need a way to display different content inside those emails based on this criteria.

1 Answer 1


Found the way - I can check variable order_entity.bundle for order type and it's value can be "default" or "recurring".

However order receipt email is sent only once, when order is placed and not when recurring order is created, so it's not used for recurring order types at all. I guess that's normal.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.