Developer Guide
Welcome to the FormaMail Developer Guide! This guide provides comprehensive technical documentation for integrating FormaMail into your applications.
What You’ll Learn
This developer guide covers everything you need to integrate FormaMail programmatically:
Getting Started
- Authentication - API keys, JWT tokens, and OAuth
- Sending Emails - Send transactional and bulk emails
- Working with Templates - Create, manage, and use templates via API
Advanced Features
- Generating Attachments - Create PDF invoices and Excel reports
- Error Handling - Handle API errors gracefully
- Rate Limiting - Understand API limits and quotas
Integration
- Best Practices - Security, performance, and optimization tips
Quick Example
Here’s a quick example to get you started with sending an email:
const response = await fetch('http://localhost:3000/api/emails/send', {
method: 'POST',
headers: {
'Authorization': 'Bearer fm_sk_abc123xyz456...',
'Content-Type': 'application/json'
},
body: JSON.stringify({
templateId: 'tmpl_welcome',
to: [
{ email: 'recipient@example.com', name: 'John Doe' }
],
variables: {
firstName: 'John',
companyName: 'Acme Corp'
}
})
});
const data = await response.json();
console.log('Email sent:', data.id);Note: All emails must use a template. Templates are created via the Dashboard.
Base URL
All API requests should be made to:
https://api.formamail.comAuthentication
FormaMail uses API keys for authentication. Include your API key in the Authorization header:
curl https://api.formamail.com/api/emails/send \
-H "Authorization: Bearer fm_sk_abc123xyz456..." \
-H "Content-Type: application/json"Learn more about Authentication →
Language Examples
The FormaMail API is a standard REST API that works with any HTTP client. Here are examples in popular languages:
- Node.js - Using fetch or axios
- Python - Using requests library
- PHP - Using cURL or Guzzle
- Ruby - Using HTTParty
- Go - Using net/http
See specific endpoint documentation in the API Reference for detailed examples.
Getting Help
- 📚 Check the API Reference for complete endpoint documentation
- 📖 Browse the User Guide for platform features
- 💬 Join our Discord Community
- 📧 Email us: developers@formamail.com
Ready to integrate? → Start with Authentication