5 minute setup

Quick Start

Get up and running with ArtaMail in under 5 minutes.

Prerequisites

  • Node.js 18 or later
  • An ArtaMail account with an API key
  • At least one email template created in the dashboard
1

Install the SDK

Choose the SDK that matches your framework:

Terminal
# Next.js
pnpm add @artatol/artamail-nextjs
# Nuxt 3
pnpm add @artatol/artamail-nuxt
# Node.js / Other
pnpm add @artatol/artamail-sdk
2

Configure your API key

Add your API key to your environment variables:

.env.local
ARTAMAIL_API_KEY=am_live_sk_your_api_key_here

You can find your API key in the Dashboard Settings.

Test vs Live Keys
Use am_test_sk_* keys during development. Test mode simulates sending without actually delivering emails or writing to the database.
3

Send your first email

Choose your framework and send a test email:

app/api/send/route.ts
1import { sendEmail } from '@artatol/artamail-nextjs/server';
2import { NextResponse } from 'next/server';
3
4export async function POST(request: Request) {
5 const { email, name } = await request.json();
6
7 const result = await sendEmail({
8 to: email,
9 template: 'welcome',
10 data: { name }
11 });
12
13 return NextResponse.json({ id: result.id });
14}
4

Verify the email was sent

Check the Transactional Emails page in your dashboard to see the email status.

Success!
Your email should appear in the dashboard within seconds. The status will update as it moves through queued → sent → delivered.

Optional: Double opt-in for signups

If you collect marketing subscribers via your app (not the preference center), enable Require double opt-in in Dashboard → Settings. When a contact opts in through the API, ArtaMail returns a confirm_url — you send the confirmation email; ArtaMail does not auto-queue it.

signup.ts
1import { ArtaMail } from '@artatol/artamail-sdk';
2
3const artamail = new ArtaMail({ apiKey: process.env.ARTAMAIL_API_KEY! });
4
5// 1. Create a template with slug "consent-confirm" (preset in dashboard; uses {{brand}}, {{legal_entity}})
6// 2. Set brand + legal entity in Settings → Brand & compliance
7// 3. Opt in + send confirm email in one call
8await artamail.optInContact({
9 email: '[email protected]',
10 optInSubtypeSlugs: ['weekly-digest'],
11 sendConfirmEmail: true,
12 confirmTemplate: 'consent-confirm',
13});
14
15// User clicks confirm_url (ArtaMail) → confirmed → redirect from template settings
Before you go live
  • Create the consent-confirm template (includes {{confirm_url}}, {{brand}}, {{legal_entity}}, {{legal_address}}, {{legal_details}})
  • Set brand, legal entity, legal address, and legal details in Settings → Brand & compliance
  • Configure subscription subtypes in Settings (e.g. weekly-digest)
  • Use doubleOptIn: false only for imports or admin overrides
Full subscriptions & consent guide

Running multiple apps?

Use one ArtaMail account per brand — isolated contacts, domains, and API keys. Multiple Products guide →