> For the complete documentation index, see [llms.txt](https://docs.personaldiscount.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.personaldiscount.io/discounteo-for-shopify/integrate-discounteo-with-your-email-service-provider/shopify-messaging/display-discount-codes-as-text-in-shopify-messaging-emails.md).

# Display discount codes as text in Shopify Messaging emails

Discounteo displays discount codes as clickable images for email service providers other than Mailchimp. In Shopify Messaging, you can display the discount code as text instead.

To do this, Discounteo must save the discount code in a customer metafield and generate the code immediately.

This feature is available for the following campaign types:

* Welcome new subscribers
* Follow up on purchases

1. Create a customer metafield to store the discount code.<br>

   <figure><img src="https://3731721370-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LZdVZovthV0SPlgxS6Y%2Fuploads%2FyVLGXjpfJr1EUP4oZvSK%2Fshopify-create-customer-metafield-for-discount-code.gif?alt=media&amp;token=11747db0-244f-40ac-afa6-12a567d63127" alt="ALT text: Shopify customer metafield for storing discount codes"><figcaption><p>Creating a Shopify customer metafield to store Discounteo discount codes</p></figcaption></figure>
2. In your Discounteo automation, enable the option to save the discount code in the customer metafield.<br>

   <figure><img src="https://3731721370-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LZdVZovthV0SPlgxS6Y%2Fuploads%2FWNY43bClHWKh8UClNzc9%2Fimage.png?alt=media&amp;token=d2ca1028-36eb-46f2-bad9-fc633d6e58d5" alt="Discounteo option to save discount code in a customer metafield"><figcaption><p>Enabling Discounteo to save generated discount code in a customer metafield</p></figcaption></figure>
3. Contact us to enable immediate discount code generation for your account.
4. Edit your Shopify workflow and add a short delay to give Discounteo time to generate and save the discount code.<br>

   <figure><img src="https://3731721370-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LZdVZovthV0SPlgxS6Y%2Fuploads%2FqOblH9j5eo3dZMYsr0Zo%2Fshopify-messaging-flow-delay.png?alt=media&amp;token=b50454e0-db19-472c-b4ba-171df0338e1d" alt="Shopify Messaging flow delay" width="286"><figcaption><p>Adding a delay to a Shopify Messaging workflow</p></figcaption></figure>
5. Edit your email template and add a Custom Liquid element.
6. In the Custom Liquid element, add a reference to the customer metafield instead of the Discounteo code snippet. To retrieve a discount code from the metafield, use the following variable: `{{ customer.metafields.namespace.key }}`

<figure><img src="https://3731721370-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LZdVZovthV0SPlgxS6Y%2Fuploads%2Fw95F1RtfCDfIAK3etMtA%2Fshopify-customer-metafield-namespace-key.png?alt=media&amp;token=dca8ce83-386c-43d6-96b8-da7959e7c6d7" alt="Shopify customer metafield namespace and key"><figcaption><p>Shopify customer metafield namespace and key for storing the discount code</p></figcaption></figure>

<figure><img src="https://3731721370-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LZdVZovthV0SPlgxS6Y%2Fuploads%2FV8MbzzbRkrhTcMwc51lV%2Fimage.png?alt=media&amp;token=333d962e-2d8e-4f17-9ef2-25e961bdbfbe" alt="Shopify Messaging email template with Custom Liquid for discount code"><figcaption><p>Shopify Messaging email template with Custom Liquid to retrieve the discount code from a customer metafield</p></figcaption></figure>
