[Node.js SDK]
NestJS
Inject Reloop into NestJS services and controllers for type-safe transactional email.
Step 1
Install the package
Add the official Node.js client to your NestJS project.
bash
npm install reloop-emailStep 2
Set your API key
Create a free Reloop account, copy your API key, and add it to your NestJS environment.
Get an API key free โbash
RELOOP_API_KEY="re_xxxxxxxx"Step 3
Send email from NestJS
Use this NestJS snippet to send your first message. Works with Modules ยท Providers.
send_email.ts
1import { Injectable } from '@nestjs/common';2import Reloop from 'reloop-email';3
4@Injectable()5export class MailService {6 private reloop = new Reloop(process.env.RELOOP_API_KEY!);7
8 async sendWelcome(to: string) {9 const { data, error } = await this.reloop.emails.send({10 from: 'Acme <onboarding@yourdomain.com>',11 to: [to],12 subject: 'Welcome',13 html: '<strong>Thanks for signing up.</strong>',14 });15
16 if (error) throw error;17 return data;18 }19}Next steps
Examples, docs, and API reference
Go deeper with working code and the full API for Node.js.
Other frameworks
Same API, framework-specific examples.
Send with NestJS.
Get an API key and ship transactional email from NestJS using the official Node.js SDK.