[Node.js SDK]
NestJS
Inject Reloop into NestJS services and controllers for type-safe transactional email.
1
Install the Node.js package
npm install reloop-email2
Send email from NestJS
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}3
GitHub, examples, and API reference
4
Need more help?
- Need help? Contact Support.
- Chat with Reloop developers on Discord.
- Check out our changelog.
- Questions? Contact Sales.
- LLM? Read llms.txt.
Send with NestJS.
Get an API key and ship transactional email from NestJS using the official Node.js SDK.