> ## Documentation Index
> Fetch the complete documentation index at: https://moengage-unity-sdk-initialization-split.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Merlin AI In-App Template Generator

> Generate responsive, accessible in-app message templates from text prompts using Merlin AI, including gamified elements and countdown timer designs.

The Merlin AI Template Generator allows you to create In-App message templates using text prompts. You can create HTML designs that are accessible, responsive, and equipped with standard tracking capabilities.

## Use Cases

Merlin AI can be used to generate various types of In-App templates. You can use Merlin AI to:

* **Create gamified templates:** Build interactive components like "Spin the Wheel" to drive user participation and reward distribution.
* **Highlight time-sensitive offers:** Generate countdown timers to emphasize sales deadlines or registration windows.
* **Capture user leads:** Design pop-ups with input fields to collect information such as email addresses or phone numbers.
* **Collect customer feedback:** Build multi-option survey forms to track user preferences or net promoter scores (NPS).
* **Announce product updates:** Create full-screen or partial pop-ups to communicate new feature launches or seasonal sales.

For industry-specific examples and ready-to-use prompts, see [In-App Template Use Cases by Industry](/user-guide/ai-and-intelligence/merlin-ai/merlin-ai-in-app-template-generator/in-app-template-use-cases).

<Info>
  **Feature Specifications**

  * **Tracking:** Automatically includes event tracking for close buttons, form submissions, and primary CTA clicks.
  * **Responsiveness:** Templates adapt to both portrait and landscape orientations by default.
  * **Accessibility:** Designs follow accessibility standards for inclusive user interaction.
</Info>

## Generate a Template

To generate an In-App template with Merlin AI, follow these steps:

1. Navigate to the **Content** step of the [In-App campaign creation](/user-guide/campaigns-and-channels/in-app-message/create/create-in-app-campaign) flow.
2. In the **Merlin AI template generator** section, click **+ Create new**.
   <img src="https://mintcdn.com/moengage-unity-sdk-initialization-split/AMr68_9iVUeBc4Kg/images/IN-APP-GENERATOR-1.png?fit=max&auto=format&n=AMr68_9iVUeBc4Kg&q=85&s=be79720edf2f7365d12b688b5c850b25" alt="IN APP GENERATOR 1" width="3032" height="294" title="IN APP GENERATOR 1" data-path="images/IN-APP-GENERATOR-1.png" />
3. Specify your requirements using one of the following methods:
   * **Select a Suggestion:** Choose a pre-defined use case, such as a *Spin the wheel pop-up* or *Survey form*.
   * **Custom Prompt:** Enter technical or design requirements in the input field.
   * **Reference Image:** Click the **Add image with your prompt** icon next to the prompt field to attach a PNG reference (for example, a screenshot or a Figma export). For more details, see [Use a reference image](#use-a-reference-image).
     <Frame>
       <img src="https://mintcdn.com/moengage-unity-sdk-initialization-split/PkX6O8kJs5cI6ytb/images/inapp-generator-image-icon.png?fit=max&auto=format&n=PkX6O8kJs5cI6ytb&q=85&s=5869405da80c6d38a165efa7f05f9d67" alt="Add image with your prompt icon in the Merlin AI prompt field" width="3212" height="1626" data-path="images/inapp-generator-image-icon.png" />
     </Frame>
4. Click the **Send** icon to generate the template.
5. Review the generated design using the preview tools:
   * **Device Preview:** Click the **Phone** icon to view the layout on a mobile screen.
   * **Preview:** Click the **Eye** icon to preview the generated template.
   * **Code Inspector:** Click the **Code** icon to view the underlying HTML code.
     <img src="https://mintcdn.com/moengage-unity-sdk-initialization-split/PkX6O8kJs5cI6ytb/images/inapp-generator-3.png?fit=max&auto=format&n=PkX6O8kJs5cI6ytb&q=85&s=4e66e5d7fd1e7f7e4fce86c6bd40922c" alt="Inapp Generator 3" width="3206" height="1728" title="Inapp Generator 3" data-path="images/inapp-generator-3.png" />
6. To refine the design, provide additional instructions in the prompt field (for example, "Change the 'Submit' button color to green" or "Add a 'Skip' option at the bottom").
   <img src="https://mintcdn.com/moengage-unity-sdk-initialization-split/PkX6O8kJs5cI6ytb/images/inapp-generator-4.gif?s=6b8441c89d0070ada4b49a07d98fc731" alt="Inapp Generator 4" width="1602" height="858" title="Inapp Generator 4" data-path="images/inapp-generator-4.gif" />
7. Each iteration creates a new **Version** card in the chat history.
   * **Preview Versions:** Click any version card (for example, Version 0, Version 1) in the chat to view that specific design in the preview pane.
   * **Edit a Version:** Click the **Pencil icon** on a version card to select it as the base for further prompt-based edits.
     <img src="https://mintcdn.com/moengage-unity-sdk-initialization-split/PkX6O8kJs5cI6ytb/images/inapp-generator-5.gif?s=e0e793bf1513f93179443dc89ab0881e" alt="Inapp Generator 5" width="1598" height="828" title="Inapp Generator 5" data-path="images/inapp-generator-5.gif" />
8. Click **Use this** to apply the generated HTML to your campaign.

## Use a Reference Image

You can attach a reference image alongside your prompt to generate a template that mirrors an existing design. This is useful when you want to replicate a screenshot, recreate a template you've seen elsewhere, or convert an approved design from a tool like Figma into an In-App template.

To generate a template from a reference image:

1. In the Merlin AI chat, click the **Image** icon next to the prompt field.
2. Upload a PNG file of the design you want to replicate.
3. Enter a prompt describing what you want (for example, *Create a similar template*).
4. Click the **Send** icon. Merlin AI generates an HTML template based on the reference image and your prompt.
5. Refine the output using follow-up prompts, the same way you would with a text-only generation.

<Frame>
  <img src="https://mintcdn.com/moengage-unity-sdk-initialization-split/PkX6O8kJs5cI6ytb/images/inapp-generator-image-reference.gif?s=b1036cb71a51eb60d702cc15dacfb48d" alt="Inapp Generator Image Reference" width="957" height="492" data-path="images/inapp-generator-image-reference.gif" />
</Frame>

<Info>
  **Image Upload Limits**

  * You can attach **one image per prompt**.
  * You can upload up to **10 images per session**.
</Info>

For tips on using a Figma export as your reference, see the [FAQs](#faqs) at the bottom of this page.

## Prompt Guidelines

To ensure accurate output, provide specific details on the layout and components. Refer to the following structure:

<Info>
  **Template Type:** Full-screen, Nudge, or Bottom sheet.

  **Use Case:** Lead generation, Promotional, or Feedback survey.

  **Core Components:** Input fields, countdown timers, or interactive wheels.

  **Functional Elements:** Specific CTA text, hex color codes, and close button placement.
</Info>

### Example: Structured Prompt

The following is an example of a comprehensive prompt for a "Spin the Wheel" campaign:

<Info>
  **Type:** Fullscreen

  **Use Case:** Lead Gen

  **Core Component:** Spin wheel with 6 slices containing the following prizes:

  * Slice 1: 10% Off (Coupon Code: SUMMER10)
  * Slice 2: 20% Off (Coupon Code: SUMMER20)
  * Slice 3: Free Shipping (Coupon Code: FREESHIP)
  * Slice 4: 15% Off (Coupon Code: SUMMER15)
  * Slice 5: Buy 1 Get 1 50% Off (Coupon Code: SUMMERBOGO)
  * Slice 6: Better Luck Next Time (No coupon code)

  **Other Components:**

  * Dismiss button (X) in top-right corner.
  * Email input field for lead capture before spinning.
  * Winning overlay screen: prize name, coupon code, and a "Shop Now" button.
  * Losing overlay screen: "Better Luck Next Time" text with a "Browse Anyway" button.

  **Theme:** Clean Summer Sale theme.

  **CTA:** Spin to Win.

  **Action Logic:** On clicking "Spin to Win," the wheel spins and lands on a random slice. If the user wins, display the winning overlay with store redirection. If the user loses, display the losing overlay with "Browse Anyway" redirection.
</Info>

## Template Management

### Save for Future Use

Generated templates can be saved for use in other campaigns:

1. To transfer the generated design to the HTML editor, click **Use this**.
   <img src="https://mintcdn.com/moengage-unity-sdk-initialization-split/PkX6O8kJs5cI6ytb/images/inapp-generator-6.png?fit=max&auto=format&n=PkX6O8kJs5cI6ytb&q=85&s=cf2374456de577c8117e7d8889bd5227" alt="Inapp Generator 6" width="3200" height="1748" title="Inapp Generator 6" data-path="images/inapp-generator-6.png" />
2. On the Content page, click the **three dots** menu.
3. Click **Save Template**. The **Save as template for future use** dialog box appears.
   <img src="https://mintcdn.com/moengage-unity-sdk-initialization-split/PkX6O8kJs5cI6ytb/images/in-app-generator-7.png?fit=max&auto=format&n=PkX6O8kJs5cI6ytb&q=85&s=74f76ed4538696c0311765e5a1d61ec4" alt="In App Generator 7" width="2996" height="1622" title="In App Generator 7" data-path="images/in-app-generator-7.png" />
4. In the **Save as** box, enter a desired name for your template.
   <img style={{ aspectRatio: '1258/760', width: '51.09%' }} src="https://mintcdn.com/moengage-unity-sdk-initialization-split/PkX6O8kJs5cI6ytb/images/in-app-generator-8.png?fit=max&auto=format&n=PkX6O8kJs5cI6ytb&q=85&s=f011f4fdc27dc0ab4e2c4d93ee607eb3" alt="In App Generator 8" width="1258" height="760" title="In App Generator 8" data-path="images/in-app-generator-8.png" />
5. Click **Save**.

<Warning>
  **Note**

  Merlin AI chat data is volatile and persisted for the **current session only**. Refreshing the browser, closing the application tab, or selecting **Restart chat** will permanently delete the conversation history and any unsaved designs.
</Warning>

### Navigation Actions

* **Resume:** Returns to the active generation session if you have navigated to other parts of the dashboard within the same session.
  <img src="https://mintcdn.com/moengage-unity-sdk-initialization-split/PkX6O8kJs5cI6ytb/images/in-app-generator-9.png?fit=max&auto=format&n=PkX6O8kJs5cI6ytb&q=85&s=cd6afa385c328c5144e2a9c83008cabf" alt="In App Generator 9" width="3016" height="564" title="In App Generator 9" data-path="images/in-app-generator-9.png" />
* **Restart Chat:** Clears all current session data to initiate a new prompt sequence.
  <img src="https://mintcdn.com/moengage-unity-sdk-initialization-split/PkX6O8kJs5cI6ytb/images/in-app-generator-10.png?fit=max&auto=format&n=PkX6O8kJs5cI6ytb&q=85&s=15fcb7e63e5fe67d5122069684476d9f" alt="In App Generator 10" width="3206" height="1668" title="In App Generator 10" data-path="images/in-app-generator-10.png" />

## FAQs

<AccordionGroup>
  <Accordion title="How do I use a Figma design as a reference for the template?">
    If your design team works in Figma, you can use the exported design as a reference image:

    1. In Figma, select the frame containing your In-App design.
    2. Export the frame as a PNG file.
    3. In the Merlin AI chat, click the **Add image with your prompt** icon and upload the exported PNG.
    4. Enter a prompt such as *Create a similar template* and click the **Send** icon.

    The same workflow applies to designs exported from other tools such as Photoshop or Sketch — Merlin AI accepts any PNG reference.
  </Accordion>

  <Accordion title="What image formats and limits apply to reference uploads?">
    Reference images must be **PNG** files. You can attach **one image per prompt**, and up to **10 images per session**.
  </Accordion>

  <Accordion title="Where can I find prompt examples for my industry?">
    See [In-App Template Use Cases by Industry](/user-guide/ai-and-intelligence/merlin-ai/merlin-ai-in-app-template-generator/in-app-template-use-cases) for ready-to-use prompts across retail and e-commerce, BFSI, entertainment and media, and travel and hospitality.
  </Accordion>

  <Accordion title="Are my generated templates saved automatically?">
    No. Merlin AI chat data is persisted for the current session only. To keep a generated template for reuse, click **Use this**, then save it from the Content page using **Save Template**. See [Save for Future Use](#save-for-future-use).
  </Accordion>
</AccordionGroup>
