Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/nayalsaurav/ai360/llms.txt

Use this file to discover all available pages before exploring further.

The Email Template Generator produces fully-styled, responsive HTML email content using Google’s Gemini 2.5 Flash model, which acts as an expert HTML email copywriter. You can guide the output with a tone, email type, participants, and a list of key points — or pick one of five built-in preset templates. The returned HTML uses inline CSS only and omits <html>, <head>, and <body> wrapper tags, so it can be dropped directly into any email-sending pipeline.

Request

POST /api/utilities/email-template-generator
Content-Type: application/json
At least one of keyPoints (a non-empty array) or template (a valid preset name) must be provided. All other fields are optional and act as style hints.
tone
string
The desired tone of the email. Examples: formal, friendly, urgent, professional, casual. Defaults to formal when omitted.
type
string
The category of email. Examples: business, marketing, transactional, announcement. Defaults to business when omitted.
recipient
string
Who the email is addressed to (e.g. "a prospective client", "John"). Defaults to "a client" when omitted.
sender
string
The sender’s name or role (e.g. "Alice from Acme Support"). Defaults to "a professional" when omitted.
company
string
The sending organisation’s name, used in the header and signature. Defaults to "an organization" when omitted.
keyPoints
string[]
An array of bullet points or topics the email body should address. Either this field (non-empty) or template must be present.
template
string
A preset template name. One of:
ValueDescription
invoicePayment reminder with billing details, amount due, due date, and payment link.
loginLogin verification / OTP email with verification code, expiry, and security note.
account_creationWelcome email confirming sign-up and introducing platform features.
newsletterNewsletter with recent updates, product highlights, and social links.
password_resetPassword-reset email with a secure link, expiry, and safety tips.
Either this field or keyPoints (non-empty) must be present.

Response

A successful request returns HTTP 200 with the following body:
success
boolean
Always true on a successful generation.
html
string
Responsive HTML email content with inline CSS. Does not include <html>, <head>, or <body> wrapper tags — only the inner email content section.
{
  "success": true,
  "html": "<div style=\"font-family: Arial, sans-serif; max-width: 600px; margin: 0 auto;\">...</div>"
}

Error Responses

StatusBodyCause
400{ "error": "Please provide key points or select a template." }Both keyPoints and template are absent or keyPoints is an empty array.
500{ "error": "Internal server error", "message": "<detail>" }Gemini API call failed, returned no HTML, or another unexpected error occurred.
You must supply either a non-empty keyPoints array or a valid template string, or the request will be rejected with 400 before the AI model is called.
The generated HTML is intended to be placed inside an email body container by your sending provider (SendGrid, Resend, SES, etc.). Do not wrap it in additional <html> or <body> tags.

Example

Request using key points
curl -X POST https://your-domain.com/api/utilities/email-template-generator \
  -H "Content-Type: application/json" \
  -d '{
    "tone": "friendly",
    "type": "marketing",
    "recipient": "new users",
    "sender": "Maya",
    "company": "BrightApp",
    "keyPoints": [
      "Welcome to BrightApp",
      "Your free trial lasts 14 days",
      "Explore the dashboard to get started",
      "Contact support at help@brightapp.io"
    ]
  }'
Response
{
  "success": true,
  "html": "<div style=\"font-family: Arial, sans-serif; max-width: 600px; margin: auto; background: #ffffff;\">\n  <div style=\"background: #6366f1; padding: 24px; text-align: center;\">\n    <h1 style=\"color: #ffffff; margin: 0;\">BrightApp</h1>\n  </div>\n  <div style=\"padding: 32px;\">\n    <p>Hi there,</p>\n    <p>Welcome to BrightApp! We're thrilled to have you on board...</p>\n    ...\n  </div>\n</div>"
}
Request using a preset template
curl -X POST https://your-domain.com/api/utilities/email-template-generator \
  -H "Content-Type: application/json" \
  -d '{
    "template": "password_reset",
    "company": "BrightApp",
    "recipient": "user@example.com"
  }'

Build docs developers (and LLMs) love