Maqetin sends the transactional email your server asks for.

One request names a template, a recipient and the data for the template. Maqetin queues the email and answers with its message id.

What one request holds

FieldWhat it holds
channelemail, the one channel built today.
templateIdThe template to send.
toA person you identified, by userId, or an address with no profile, by email.
fromAn address on a verified sending domain of your workspace.
dataThe merge data for the template.

The send API page lists every field, with its answers.

Who it reaches

  • It reaches a person who unsubscribed from marketing.
  • It never reaches a suppressed address.
  • It has no unsubscribe link.

A retry sends once

Send an Idempotency-Key with the request. A retry with the same key is the same message, and it is sent once.

Send it

HTTP

curl https://api.maqetin.com/v1/public/messages \
  -H 'Authorization: Bearer mq_sec_…' \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: order-42:receipt' \
  -d '{
  "channel": "email",
  "templateId": "tpl_receipt",
  "to": { "email": "ada@example.com" },
  "from": "Receipts <receipts@mail.harbourmoney.co.uk>",
  "subject": "Your receipt",
  "data": { "order": { "id": "o_42", "total": 12.5 } }
}'

Node

import { MaqetinServer } from '@maqetin/sdk-js/server';

const mq = new MaqetinServer({ secretKey: process.env.MAQETIN_SECRET_KEY });
const { messageId } = await mq.messages.send({
  channel: 'email',
  templateId: 'tpl_receipt',
  to: { userId: 'u_42' }, // or { email: 'guest@example.com' }
  from: 'Harbour Money <receipts@mail.harbourmoney.co.uk>',
  data: { order: { id: 'o_42', total: 12.5 } },
  idempotencyKey: 'order-42:receipt',
});

Keys and limits

The request needs a secret key with the messages:send scope. A key sends up to 300 messages a minute.

The server entry of the SDK refuses to run in a web page, so the key stays on your server.

Create a workspace and send your first email.