# Display coupons

YayMail provides the feature to include the coupon used in the New Order email confirmation, making it easy for the shop team to see which coupon was applied to the order.

Here's a general guide on how to achieve this:&#x20;

### Step 1 - Create a coupon&#x20;

**WordPress dashboard > Marketing > Coupons > Add Coupon**

<figure><img src="/files/5pjtgpTS7GDvyT2CdjK0" alt=""><figcaption></figcaption></figure>

Then, name the coupon, select the discount type (percentage discount, fixed basket discount, or fixed product discount), enter the value in the coupon amount field, and hit publish.

<figure><img src="/files/NtEbJWH36BZTBxpqY5Y2" alt=""><figcaption></figcaption></figure>

### Step 2 - Check the orders

**WordPress dashboard > WooCommerce > Orders**

Here, the shop team will handle all orders, including viewing the order number and the customer's name (e.g. #1183 is the order ID followed by the customer name).

<figure><img src="/files/z0tG2VZ0l5YKb6oZd9tM" alt=""><figcaption></figcaption></figure>

### Step 3 - Access YayMail

**WordPress dashboard > YayCommerce > YayMail**

Select the orders for which you want to display the coupon using the YayMail builder.

<figure><img src="/files/ipBADQuItrMK7z5F5fj8" alt=""><figcaption></figcaption></figure>

Click on the ‘**Shortcodes**’ button, where a list of shortcodes will appear.&#x20;

<figure><img src="/files/Q8Ao83wpEIFGywZxLLbV" alt=""><figcaption></figcaption></figure>

### Step 4 - Copy and paste the shortcode

Enter 'coupon' in the search field to find the code `[yaymail_order_coupon_codes]`&#x20;

Copy this code and paste it into the text editor.

<figure><img src="/files/A5EzPWjEFUX1pYCuKmfV" alt=""><figcaption></figcaption></figure>

After using the shortcode mentioned above, the email template will display the coupon that customers choose to use in their orders.

<figure><img src="/files/WjN0n9lytQXcRO8qUGIp" alt=""><figcaption></figcaption></figure>

Now, open your Gmail and the coupon used in the order will also be revealed to your customer.

<figure><img src="/files/HhwzQmrCpcRf21xIFaFY" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.yaycommerce.com/yaymail/guides/display-coupons.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
