Customer.accepts_marketing in email templates - allowed?

I’d like to add a bit of a promotion to my transactional emails if the customer agreed to email marketing, to avoid sending an extra email.

Is using {% if customer.accepts_marketing %} in the email template ok for this? From my limited testing it seems ok, but would love some advice.

Hi @BobbyMacCheese

Yes, using {% if customer.accepts_marketing %} in your email template is a correct approach. This condition ensures that promotional content is only displayed to customers who have agreed to email marketing. Test thoroughly to confirm it works consistently across your email scenarios.

If you have other questions, I will also answer them.

Best regards,

Daisy