npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@nestixis/nestjs-mailer

v1.0.2

Published

NestJS implementation for Nodemailer and React

Readme

NestJS Mailer

@nestixis/nestjs-mailer is a NestJS module that integrates nodemailer for sending emails and uses React to render email templates.

Features

  • React-based templates: Allows you to use React components to create dynamic and customizable email templates.
  • Nodemailer integration: Leverages nodemailer for reliable email delivery.

Installation

To install the package, run the following command:

npm install @nestixis/nestjs-mailer

Configuration

Mailer SDK Module Configuration

import { MailerSdkModule } from '@nestixis/nestjs-mailer';
import { Module } from '@nestjs/common';
import { AppController } from './app.controller';
import { AppService } from './app.service';

@Module({
  imports: [
    MailerSdkModule.register({
      auth: {
        user: '',
        password: '',
        host: 'sandbox-smtp.mailcatch.app',
        port: 2525,
        ssl: false,
      },
      from: '[email protected]',
    }),
  ],
  controllers: [AppController],
  providers: [AppService],
})
export class AppModule {}

MailerSdkModuleOptions

export class MailerSdkModuleOptions {
  auth: {
    user: string;
    password: string;
    host: string;
    port: number;
    ssl: boolean;
  };
  from: string;
}

Usage

Sending Emails with React Templates

You can now use the EmailSender to send emails by passing a React component as the email template. Here's an example of how you would send an email using a React-based template:

import {
  EmailSenderInterface,
  MAILER_SDK_CLIENT,
} from '@nestixis/nestjs-mailer';
import { Inject, Injectable } from '@nestjs/common';
import InviteAdminWithAccountTemplate from './invite-admin-with-account-template';

@Injectable()
export class AppService {
  constructor(
    @Inject(MAILER_SDK_CLIENT)
    private readonly emailSender: EmailSenderInterface,
  ) {}
  async getHello(): Promise<void> {
    const translations = {
      titleInside: { subpart1: 'Welcome', subpart2: ' to the platform!' },
      contentPart1: 'Hello',
      contentPart2: 'Your admin account has been created.',
      contentPart3: {
        subpart1: 'Click here to activate your account: ',
        subpart2: 'Activate',
        subpart3: '.',
      },
      contentPart4: {
        subpart1: 'To set your password, click here: ',
        subpart2: 'Set password',
      },
    };

    const emailContent = await InviteAdminWithAccountTemplate({
      translation: translations,
      language: 'en',
      invitationHref: 'xxx',
      passwordHref: 'xxx',
      logoUrl: 'logo.png',
    });

    await this.emailSender.sendEmail(
      '[email protected]',
      'Admin Invitation',
      emailContent,
    );
  }
}

Example React Email Template

Below is an example of a React email template using @react-email/components to structure your email content:

import {
  Body,
  Container,
  Head,
  Html,
  Img,
  Link,
  Section,
  Text,
} from '@react-email/components';
import * as React from 'react';

export default function InviteAdminWithAccountTemplate({
  translation,
  language,
  invitationHref,
  passwordHref,
  logoUrl,
}) {
  return (
    <Html lang={language}>
      <Head>
        <style>{/* Your custom styles here */}</style>
      </Head>
      <Body style={{ fontFamily: 'Arial, sans-serif' }}>
        <Section>
          <Container>
            {logoUrl ? (
              <Img src={logoUrl} alt="Logo" />
            ) : (
              <Text>{translation.titleInside}</Text>
            )}
            <Text>{translation.contentPart1}</Text>
            <Text>{translation.contentPart2}</Text>
            <Text>
              {translation.contentPart3.subpart1}
              <Link href={invitationHref}>
                {translation.contentPart3.subpart2}
              </Link>
              {translation.contentPart3.subpart3}
            </Text>
            <Text>
              {translation.contentPart4.subpart1}
              <Link href={passwordHref}>
                {translation.contentPart4.subpart2}
              </Link>
            </Text>
          </Container>
        </Section>
      </Body>
    </Html>
  );
}

API Reference

EmailSenderInterface

The EmailSenderInterface defines the method sendEmail for sending emails:

export interface EmailSenderInterface {
  sendEmail(to: string, subject: string, template: React.ReactElement<any, string | React.JSXElementConstructor<any>>): Promise<void>;
}