Skip to main content

Prerequisites

To get the most out of this guide, you’ll need to:
You can find your API keys in your SendPost Dashboard. Make sure to use your Sub-Account API Key for sending emails.

1. Install Dependencies

npm

2. Environment Setup

Create or update your .env file:

3. Create Server Utility

Create server/utils/sendpost.ts:
TypeScript

4. Send Your First Email

Using Server API Route

Create server/api/send-email.post.ts:
TypeScript

Using Server Action

Create server/actions/email.ts:
TypeScript

5. Common Use Cases

Welcome Email API Route

Create server/api/welcome-email.post.ts:
TypeScript

Password Reset Email

Create server/api/password-reset.post.ts:
TypeScript

6. Using in Components

Client-Side Form

Create pages/contact.vue:
Vue

7. Runtime Config

Add to nuxt.config.ts:
TypeScript
Make sure your sender email domain is verified in your SendPost account before sending emails.

8. Next Steps

Explore more examples and use cases:

Nuxt.js Documentation

Learn more about Nuxt.js framework

SendPost JavaScript SDK

View the official SDK package on npm

Personalization Guide

Learn how to personalize emails with Handlebars templates