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

@tlouverse/graph-mailer-nestjs

v0.2.1

Published

NestJS module for @tlouverse/graph-mailer.

Readme

@tlouverse/graph-mailer-nestjs

npm version license

English · Français


English

NestJS module for @tlouverse/graph-mailer. Registers GraphMailer as a global provider so you can inject it anywhere in your application.

Installation

npm install @tlouverse/graph-mailer-nestjs

Setup

Register the module once in your root AppModule.

Static configuration:

import { GraphMailerModule } from '@tlouverse/graph-mailer-nestjs';

@Module({
  imports: [
    GraphMailerModule.forRoot({
      tenantId: 'your-tenant-id',
      clientId: 'your-client-id',
      clientSecret: 'your-client-secret',
      defaultFrom: '[email protected]',
    }),
  ],
})
export class AppModule {}

Async configuration (e.g. with ConfigService):

import { GraphMailerModule } from '@tlouverse/graph-mailer-nestjs';
import { ConfigModule, ConfigService } from '@nestjs/config';

@Module({
  imports: [
    ConfigModule.forRoot(),
    GraphMailerModule.forRootAsync({
      imports: [ConfigModule],
      inject: [ConfigService],
      useFactory: (config: ConfigService) => ({
        tenantId: config.getOrThrow('AZURE_TENANT_ID'),
        clientId: config.getOrThrow('AZURE_CLIENT_ID'),
        clientSecret: config.getOrThrow('AZURE_CLIENT_SECRET'),
        defaultFrom: config.get('MAIL_DEFAULT_FROM'),
      }),
    }),
  ],
})
export class AppModule {}

Injection

Once registered, inject GraphMailer directly by type:

import { Injectable } from '@nestjs/common';
import { GraphMailer } from '@tlouverse/graph-mailer-nestjs';

@Injectable()
export class NotificationService {
  constructor(private readonly mailer: GraphMailer) {}

  async sendWelcome(to: string) {
    await this.mailer.send({
      to,
      subject: 'Welcome',
      html: '<p>Welcome aboard!</p>',
    });
  }
}

API

This package re-exports everything from @tlouverse/graph-mailer — you only need to import from @tlouverse/graph-mailer-nestjs in your NestJS project.

| Export | Description | |---|---| | GraphMailerModule | NestJS module — register with forRoot or forRootAsync | | GraphMailerAsyncOptions | Type for forRootAsync options | | GraphMailer | Mailer class (injectable) | | GraphMailerConfig | Config type | | SendMailOptions | Send options type | | Address | Address type | | Attachment | Attachment type | | GraphMailError | Graph API error | | GraphAuthError | Token acquisition error |

For the full GraphMailer API, see the @tlouverse/graph-mailer documentation.

Azure prerequisites

See @tlouverse/graph-mailer — Azure prerequisites.


Français

Module NestJS pour @tlouverse/graph-mailer. Enregistre GraphMailer comme provider global, injectable partout dans l'application.

Installation

npm install @tlouverse/graph-mailer-nestjs

Configuration

Enregistrez le module une seule fois dans votre AppModule racine.

Configuration statique :

import { GraphMailerModule } from '@tlouverse/graph-mailer-nestjs';

@Module({
  imports: [
    GraphMailerModule.forRoot({
      tenantId: 'votre-tenant-id',
      clientId: 'votre-client-id',
      clientSecret: 'votre-client-secret',
      defaultFrom: '[email protected]',
    }),
  ],
})
export class AppModule {}

Configuration asynchrone (ex. avec ConfigService) :

import { GraphMailerModule } from '@tlouverse/graph-mailer-nestjs';
import { ConfigModule, ConfigService } from '@nestjs/config';

@Module({
  imports: [
    ConfigModule.forRoot(),
    GraphMailerModule.forRootAsync({
      imports: [ConfigModule],
      inject: [ConfigService],
      useFactory: (config: ConfigService) => ({
        tenantId: config.getOrThrow('AZURE_TENANT_ID'),
        clientId: config.getOrThrow('AZURE_CLIENT_ID'),
        clientSecret: config.getOrThrow('AZURE_CLIENT_SECRET'),
        defaultFrom: config.get('MAIL_DEFAULT_FROM'),
      }),
    }),
  ],
})
export class AppModule {}

Injection

Une fois enregistré, injectez GraphMailer directement par type :

import { Injectable } from '@nestjs/common';
import { GraphMailer } from '@tlouverse/graph-mailer-nestjs';

@Injectable()
export class NotificationService {
  constructor(private readonly mailer: GraphMailer) {}

  async sendWelcome(to: string) {
    await this.mailer.send({
      to,
      subject: 'Bienvenue',
      html: '<p>Bienvenue !</p>',
    });
  }
}

API

Ce package réexporte tout depuis @tlouverse/graph-mailer — dans un projet NestJS, importez uniquement depuis @tlouverse/graph-mailer-nestjs.

| Export | Description | |---|---| | GraphMailerModule | Module NestJS — à enregistrer avec forRoot ou forRootAsync | | GraphMailerAsyncOptions | Type des options pour forRootAsync | | GraphMailer | Classe mailer (injectable) | | GraphMailerConfig | Type de configuration | | SendMailOptions | Type des options d'envoi | | Address | Type d'adresse | | GraphMailError | Erreur API Graph | | GraphAuthError | Erreur d'acquisition du token |

Pour l'API complète de GraphMailer, voir la documentation @tlouverse/graph-mailer.

Prérequis Azure

Voir @tlouverse/graph-mailer — Prérequis Azure.


License

MIT