Skip to content
ThorMail

Quick Start

This guide will walk you through sending your first message with ThorMail.

  • ThorMail installed and running (Installation Guide)
  • Access to the ThorMail dashboard
  • A delivery adapter account (SMTP, SendGrid, etc.)
  • Valid License Key (Free, get one at thormail.io by verifying your email)

When you start ThorMail for the first time, an admin account and a default workspace are automatically created for you.

  1. Get your Admin Password

    The initial password is randomly generated and printed to the container logs. Run:

    Terminal window
    docker logs thormail-backend
    # Or with Docker Compose:
    docker compose logs backend

    Look for a line similar to: Admin account created: [email protected] / password: <random_string>

  2. Log in to the Dashboard

    • Open http://localhost:3000
    • Log in with your configured EMAIL and the password from the logs.
  3. Access your Workspace

    • You will be automatically redirected to your default Workspace.
    • Copy the Workspace ID and API Key from the Developers section in the sidebar.
  1. Go to Adapters in the sidebar

  2. Manage your Adapters

    • Install: Browse the list and install new adapters (e.g., SendGrid, Mailgun).
    • Configure: Click on an installed adapter to enter your credentials (e.g., API Key, SMTP host).
  3. Click Save & Test to verify the configuration

Use the API to send a message:

Terminal window
curl -X POST https://your-server:4000/v1/send \
-H "Content-Type: application/json" \
-H "X-Workspace-ID: 1" \
-H "X-API-Key: your-api-key" \
-d '{
"subject": "Hello from ThorMail!",
"body": "<h1>Welcome!</h1><p>This is your first message.</p>"
}'
{
"id": 12345,
"status": "accepted"
}

The 202 Accepted response means your message has been queued for delivery. ThorMail will process it asynchronously.

Personalize your messages with template variables:

Terminal window
curl -X POST https://your-server:4000/v1/send \
-H "Content-Type: application/json" \
-H "X-Workspace-ID: 1" \
-H "X-API-Key: your-api-key" \
-d '{
"subject": "Welcome, {{name}}!",
"body": "<h1>Hello {{name}}!</h1><p>Your order #{{order_id}} has been confirmed.</p>",
"data": {
"name": "John",
"order_id": "ORD-12345"
}
}'

ThorMail uses Handlebars-style {{variable}} syntax for template substitution.

Check the status of your messages:

  1. Go to Queue in the dashboard
  2. Find your message by ID or recipient
  3. View the delivery status and any error details

Send to multiple recipients in one request:

Terminal window
curl -X POST https://your-server:4000/v1/send-batch \
-H "Content-Type: application/json" \
-H "X-Workspace-ID: 1" \
-H "X-API-Key: your-api-key" \
-d '{
"subject": "Monthly Newsletter",
"body": "<h1>Hello {{name}}!</h1><p>Here is your monthly update...</p>",
"emails": [
{ "to": "[email protected]", "data": { "name": "Alice" } },
{ "to": "[email protected]", "data": { "name": "Bob" } },
{ "to": "[email protected]", "data": { "name": "Carol" } }
]
}'

Now that you’ve sent your first message, explore more features: