Skip to main content

Prerequisites

Send email

const MAILRIFY_API_KEY = 'YOUR_API_KEY';

export async function POST() {
  const res = await fetch('https://app.mailrify.com/api/v1/emails', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      Authorization: `Bearer ${MAILRIFY_API_KEY}`,
    },
    body: JSON.stringify({
      from: 'Your app <[email protected]>',
      to: '[email protected]',
      subject: 'Welcome to Mailrify ๐Ÿš€',
      html: '<p>It works! ๐Ÿ‘‹</p>',
      text: 'It works!'
    })
  });

  if (res.ok) {
    const data = await res.json();
    return Response.json(data);
  }
}

More

  • Explore the API Reference to discover additional endpoints you can call from Vercelโ€™s functions for workflows beyond sending a single email.