# Generate email from template

**Action ID:** `generate_email_from_template_fsi`

## Description

Quickly create an email content by filling in pre-written content from a template.

## Input Parameters

| Name            | Type     | Required | Default           | Description                                                                                                            |
| --------------- | -------- | :------: | ----------------- | ---------------------------------------------------------------------------------------------------------------------- |
| email\_template | dropdown |     -    | Credit/debit card | The email template to use for generating the email content. Available options: Credit/debit card, Insurance, Promotion |
| email\_content  | string   |     ✓    | -                 | The email content to include in the template.                                                                          |
| hero\_image     | string   |     ✓    | -                 | The hero image to include in the email. Accepts JPEG, PNG, SVG, WebP, GIF formats.                                     |
| cta             | string   |     ✓    | -                 | The call to action link to include in the email.                                                                       |

<details>

<summary>View JSON Schema</summary>

**Input Schema**

```json
{
  "description": "Generate email from template node input.",
  "properties": {
    "email_template": {
      "default": "Credit/debit card",
      "description": "The email template to use for generating the email content.",
      "enum": [
        "Credit/debit card",
        "Insurance",
        "Promotion"
      ],
      "title": "Email template",
      "type": "string"
    },
    "email_content": {
      "description": "The email content to include in the template.",
      "title": "Email content",
      "type": "string"
    },
    "hero_image": {
      "description": "The hero image to include in the email.",
      "title": "Hero image",
      "type": "string"
    },
    "cta": {
      "description": "The call to action link to include in the email.",
      "title": "Call to action",
      "type": "string"
    }
  },
  "required": [
    "email_content",
    "hero_image",
    "cta"
  ],
  "title": "GenerateEmailFromTemplateNodeInput",
  "type": "object"
}
```

</details>

## Output Parameters

| Name           | Type   | Description                                          |
| -------------- | ------ | ---------------------------------------------------- |
| file\_url      | string | URL to the generated email file (HTML format)        |
| email\_content | string | The content of the email generated from the template |

<details>

<summary>View JSON Schema</summary>

```json
{
  "description": "Generate email from template node output.",
  "properties": {
    "file_url": {
      "title": "File generated",
      "type": "string"
    },
    "email_content": {
      "description": "The content of the email generated from the template",
      "title": "Email content",
      "type": "string"
    }
  },
  "required": [
    "file_url",
    "email_content"
  ],
  "title": "GenerateEmailFromTemplateNodeOutput",
  "type": "object"
}
```

</details>

## How It Works

This node takes your email content, hero image, and call-to-action, then combines them with a professionally designed FSI (Financial Services Industry) email template. The node processes your inputs, applies the selected template styling and layout, inserts your content and images, and generates both an HTML email file and returns the complete email content ready for sending through email service providers.

## Usage Examples

### Example 1: Credit Card Promotion

**Input:**

```
email_template: "Credit/debit card"
email_content: "Introducing the new Premium Rewards Card with 3% cashback on all purchases, no annual fee for the first year, and exclusive travel benefits. Apply today and start earning rewards!"
hero_image: "https://example.com/images/premium-card.jpg"
cta: "https://bank.example.com/apply-now"
```

**Output:**

```
file_url: "https://storage.example.com/emails/premium-card-email.html"
email_content: "<!DOCTYPE html><html>...complete formatted HTML email with credit card template styling...</html>"
```

### Example 2: Insurance Policy Announcement

**Input:**

```
email_template: "Insurance"
email_content: "Protect what matters most with our comprehensive Life Insurance plan. Coverage up to $1M, flexible payment options, and 24/7 customer support. Get a free quote in minutes."
hero_image: "https://example.com/images/family-insurance.jpg"
cta: "https://insurance.example.com/get-quote"
```

**Output:**

```
file_url: "https://storage.example.com/emails/insurance-offer.html"
email_content: "<!DOCTYPE html><html>...complete formatted HTML email with insurance template styling...</html>"
```

### Example 3: Seasonal Banking Promotion

**Input:**

```
email_template: "Promotion"
email_content: "Special limited-time offer! Open a new checking account and receive a $200 bonus. Plus enjoy zero monthly fees, unlimited transactions, and exclusive member benefits."
hero_image: "https://example.com/images/banking-promo.jpg"
cta: "https://bank.example.com/promotions/checking-bonus"
```

**Output:**

```
file_url: "https://storage.example.com/emails/checking-promo.html"
email_content: "<!DOCTYPE html><html>...complete formatted HTML email with promotion template styling...</html>"
```

## Common Use Cases

* **Credit Card Marketing**: Promote new credit card products, rewards programs, or special APR offers to potential customers
* **Insurance Campaigns**: Announce new insurance products, policy renewals, or coverage upgrades with professional templates
* **Banking Promotions**: Advertise special offers, account bonuses, or seasonal campaigns to existing and prospective customers
* **Product Launches**: Introduce new financial products with eye-catching hero images and clear calls-to-action
* **Customer Retention**: Send targeted promotional emails to retain customers with exclusive offers and benefits
* **Financial Education**: Share financial tips and product information using branded, professional email templates
* **Seasonal Campaigns**: Create holiday or event-specific financial service promotions with consistent branding

## Error Handling

| Error Type                 | Cause                                          | Solution                                                                   |
| -------------------------- | ---------------------------------------------- | -------------------------------------------------------------------------- |
| Invalid Image URL          | Hero image URL is inaccessible or invalid      | Verify the image URL is publicly accessible and returns a valid image file |
| Invalid Image Format       | Image format not supported                     | Use supported image formats: JPEG, PNG, SVG, WebP, or GIF                  |
| Missing Required Fields    | One or more required fields are empty          | Ensure email\_content, hero\_image, and cta fields are all provided        |
| Invalid CTA URL            | Call-to-action URL is malformed                | Provide a valid URL starting with http\:// or https\://                    |
| Template Generation Failed | System error during email generation           | Retry the request or check that all inputs are properly formatted          |
| File Upload Failed         | Unable to save generated email file            | Check storage service availability and retry                               |
| Content Too Long           | Email content exceeds reasonable length limits | Shorten the email content to a more concise message                        |

## Notes

* **FSI Compliance**: Templates are designed for Financial Services Industry communications with appropriate styling and layouts.
* **Template Selection**: Choose "Credit/debit card" for card-related offers, "Insurance" for policy information, or "Promotion" for general banking promotions.
* **Hero Images**: Use high-quality images (minimum 600px wide) that are relevant to your message and visually appealing.
* **Call-to-Action**: Ensure your CTA URL is tested and leads to a valid landing page with a clear next step for recipients.
* **Email Content**: Keep content concise and focused on key benefits. Aim for 2-3 short paragraphs for best engagement.
* **File Output**: The file\_url provides a hosted HTML version of the email that can be used directly with email service providers.
* **Responsive Design**: Templates are mobile-responsive and will display correctly on various devices and email clients.
* **Brand Consistency**: Templates maintain professional FSI branding standards while allowing customization with your content and images.


---

# 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.agenticflow.ai/reference/nodes/generate_email_from_template_fsi.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.
