For our main products (radios), we offer one of our digital products for free with the purchase of a radio (each radio has a corresponding digital product). Currently, our process is set so that the customer receives a discount code for the digital product in a post-purchase email flow. Unfortunately, it is not guaranteed that the customer will receive post-purchase flow emails (for example: they have unsubscribed from our list; they have strict settings on a private email server; etc...). However, they are essentially guaranteed to receive the order confirmation email.
We know there is a way to add this discount code to the confirmation email via Settings > Notificaitons > Order Confirmation. Is there anyone who has done something similar that can give us an example of the code they wrote? We aren't sure how to write the code, but feel like this is such a small task to go through the steps of hiring a third party coder.