Developer GuideOverview

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

Advanced Features

Integration


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.com

Authentication

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


Ready to integrate? → Start with Authentication