Skip to content
API
Transactional emails

Sending transactional emails

Sending transactional emails with Plunk unlocks another layer of connectivity.

POST /v1/send

Used to send transactional emails to a single recipient or multiple recipients at once. Transactional emails are programmatically sent emails that are considered to be part of your application's workflow. This could be a password reset email, a billing email or other non-marketing emails.

Authorization

This endpoint can only be accessed with a secret key.

Example

await fetch('https://api.useplunk.com/v1/send', {
    method: "POST",
    headers: {
        "Content-Type": "application/json",
        "Authorization": "Bearer SECRET_KEY", // Put your API key here
    },
    body: JSON.stringify({
        "to": "hello@useplunk.com",
        "subject": "Please confirm your email",
        "body": "<h1>Confirm your email</h1><p>Click <a href='https://app.useplunk.com/subscribe/ID'>here</a> to confirm your email.</p>",
    }),
});

Using Markdown

It is possible to use Markdown when sending a transactional email. Plunk will automatically apply the same styling as the email templates you make in the editor.

Any email with a body that starts with # will be treated as Markdown.

await fetch('https://api.useplunk.com/v1/send', {
    method: "POST",
    headers: {
        "Content-Type": "application/json",
        "Authorization": "Bearer SECRET_KEY", // Put your API key here
    },
    body: JSON.stringify({
        "to": "hello@useplunk.com",
        "subject": "Welcome!",
        "body": "# Hello",
    }),
});
Last updated on January 17, 2023