How can I customize order confirmation emails based on specific products ordered?

I want to customize the order confirmation emails that the customers get so that they get a message specific to what they ordered. For example, a purchase of product A sends a message specific to that and a purchase of product B sends a different message. I have tried altering the code as follows:

Now I have two questions:

  1. How can I tell if what I did is working? When I click preview, it appears as if nothing has changed.

  2. How do I alter it even further so if someone chooses product A, option 1, they get a message and Product A, option 2 gets a different message?

Is this even possible?

  1. The order confirmation email preview show a specific order, but you can’t choose which order. Therefore this functionality is not really useful to test different scenarios. You need to create a certain number of orders you need to cover all your cases in the backend and send you an email to verify it the logic you create works.

  2. Yes, is possible. The line_item.variant returns a variant object and you can access option1, option2 and option3.