App Selly has post-sale feature that can display discount code on "thank you" page for your store:
Tira here, from Shopify Support.
Great question! Thank you @Risa for the app recommendation. I'm happy to help with some more suggestions:
You can add the discount code to the Order Confirmation notification (email) that is sent out to customers. You can follow our guide on how to edit a notification template here: Editing a specific notification template. You can type some text and the discount code into the body of your notification, where you would like the discount code to show up. To learn more on how to create a discount code, you can view our help doc here: Creating discounts. You can create a discount based on a percentage, fixed-amount, Buy X Get Y, or a free shipping discount.
You can also look into pop-up apps from our App Store. These apps allow you to add a customized pop-up to your store, with features such as adding a message along with a discount code, or allow your customers to sign-up for your mailing list.
Here are some of my recommendations:
Privy - You can run exit pop-ups that are customizable, and with A/B testing to see which pop-ups best work with your customers.
WooHoo - Discount Email Pop ups - This app has spin pop-up games that pop-up when your customers exit your store or abandon your cart.
Personizely Exit & Email Popup - Includes exit, email, and messenger pop-ups.
You can find similar apps here. If you have any questions about these apps, you can contact the third-party developer by using the information listed underneath the "Support" section of the app's page.
Let me know if that helps!