PlunkPlunk
Tutorials

Send Your First Email

Send a transactional email in 5 minutes

1. Get your API key

  1. Go to Settings → General
  2. Copy your Secret Key (starts with sk_)

2. Send the email

curl -X POST https://next-api.useplunk.com/v1/send \
  -H "Authorization: Bearer sk_your_secret_key" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "user@example.com",
    "subject": "Hello from Plunk",
    "body": "<p>Your first email!</p>"
  }'

3. With variables

await fetch('https://next-api.useplunk.com/v1/send', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${process.env.PLUNK_SECRET_KEY}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    to: user.email,
    subject: 'Reset your password',
    body: '<p>Hi {{name}}, click here: <a href="{{resetLink}}">Reset</a></p>',
    name: user.name,
    resetLink: `https://app.com/reset/${token}`
  })
});

4. Using a template

  1. Create template in Templates → Create Template
  2. Send using template ID:
{
  to: user.email,
  template: 'clx123abc456',
  name: user.name,
  resetLink: resetUrl
}