Send Email in Markdown
Send transactional emails using Markdown content format
The MARKDOWN content type is the default format for sending transactional emails. It provides a simple way to write formatted emails using standard Markdown syntax.
Quick Example
curl -X POST https://lumail.io/api/v1/emails \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"to": "user@example.com",
"subject": "Welcome {{name}}!",
"content": "# Hello {{name}}!\n\nWelcome to our platform.\n\n## Getting Started\n\n- Step one\n- Step two\n- Step three",
"contentType": "MARKDOWN",
"from": "hello@yourdomain.com"
}'
Supported Markdown Syntax
Text Formatting
This is **bold text** and this is _italic text_.
You can also use ~~strikethrough~~ text.
Headings
# Heading 1
## Heading 2
### Heading 3
Lists
Unordered list:
- Item one
- Item two
- Item three
Ordered list:
1. First step
2. Second step
3. Third step
Links
Visit our [website](https://example.com) for more information.
Or use a raw URL: https://example.com
Images

Blockquotes
> This is a blockquote.
> It can span multiple lines.
Horizontal Rules
Content above
---
Content below
Variable Substitution
Use double curly braces to insert subscriber data:
Hello {{name | 'there'}}!
Your email is {{email}}.
Available Variables
| Variable | Description |
|---|---|
{{name}} | Subscriber's name |
{{email}} | Subscriber's email address |
{{phone}} | Subscriber's phone number |
{{unsubscribeUrl}} | Unsubscribe link |
{{onlineUrl}} | View in browser link |
{{org-name}} | Organization name |
{{customField}} | Any custom field |
Default Values
Provide fallback values for empty fields:
Hello {{name | 'Friend'}}!
If name is empty, "Friend" will be used instead.
Complete Example
{
"to": "customer@example.com",
"subject": "Your order #{{orderNumber}} is confirmed!",
"contentType": "MARKDOWN",
"content": "# Thanks for your order, {{name}}!\n\nYour order **#{{orderNumber}}** has been confirmed.\n\n## Order Summary\n\n- **Total:** {{orderTotal}}\n- **Shipping:** {{shippingMethod}}\n- **Estimated Delivery:** {{deliveryDate}}\n\n---\n\nQuestions? Reply to this email or visit our [Help Center](https://example.com/help).\n\nThanks for shopping with us!",
"from": "orders@yourstore.com",
"replyTo": "support@yourstore.com",
"preview": "Your order has been confirmed"
}
Automatic Features
When using Markdown format, Lumail automatically:
- Converts to HTML for rich email client rendering
- Generates plain text version for compatibility
- Adds unsubscribe link if not present in content
- Tracks opens via invisible pixel
- Tracks clicks by wrapping links
Best Practices
- Use headings to structure your content
- Keep paragraphs short for better readability
- Use lists for multi-step instructions
- Always provide fallbacks for personalization variables
- Test with subscribers who have missing data fields