{"id":16535007,"url":"https://github.com/ifaim/nestjs-nodemailer","last_synced_at":"2025-07-29T08:08:20.339Z","repository":{"id":57117165,"uuid":"147866345","full_name":"ifaim/nestjs-nodemailer","owner":"ifaim","description":null,"archived":false,"fork":false,"pushed_at":"2019-01-03T00:59:01.000Z","size":49,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-10T20:27:48.973Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ifaim.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-09-07T19:29:24.000Z","updated_at":"2020-08-31T13:35:46.000Z","dependencies_parsed_at":"2022-08-23T04:40:27.703Z","dependency_job_id":null,"html_url":"https://github.com/ifaim/nestjs-nodemailer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ifaim/nestjs-nodemailer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ifaim%2Fnestjs-nodemailer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ifaim%2Fnestjs-nodemailer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ifaim%2Fnestjs-nodemailer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ifaim%2Fnestjs-nodemailer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ifaim","download_url":"https://codeload.github.com/ifaim/nestjs-nodemailer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ifaim%2Fnestjs-nodemailer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267652763,"owners_count":24122097,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T18:26:08.161Z","updated_at":"2025-07-29T08:08:20.316Z","avatar_url":"https://github.com/ifaim.png","language":"TypeScript","funding_links":["https://opencollective.com/nest","https://paypal.me/kamilmysliwiec"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"http://nestjs.com/\" target=\"blank\"\u003e\u003cimg src=\"https://nestjs.com/img/logo_text.svg\" width=\"320\" alt=\"Nest Logo\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n[travis-image]: https://api.travis-ci.org/nestjs/nest.svg?branch=master\n[travis-url]: https://travis-ci.org/nestjs/nest\n[linux-image]: https://img.shields.io/travis/nestjs/nest/master.svg?label=linux\n[linux-url]: https://travis-ci.org/nestjs/nest\n\n  \u003cp align=\"center\"\u003eA progressive \u003ca href=\"http://nodejs.org\" target=\"blank\"\u003eNode.js\u003c/a\u003e framework for building efficient and scalable server-side applications, heavily inspired by \u003ca href=\"https://angular.io\" target=\"blank\"\u003eAngular\u003c/a\u003e.\u003c/p\u003e\n    \u003cp align=\"center\"\u003e\n\u003ca href=\"https://www.npmjs.com/~nestjscore\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/@nestjs/core.svg\" alt=\"NPM Version\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://www.npmjs.com/~nestjscore\"\u003e\u003cimg src=\"https://img.shields.io/npm/l/@nestjs/core.svg\" alt=\"Package License\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://www.npmjs.com/~nestjscore\"\u003e\u003cimg src=\"https://img.shields.io/npm/dm/@nestjs/core.svg\" alt=\"NPM Downloads\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://travis-ci.org/nestjs/nest\"\u003e\u003cimg src=\"https://api.travis-ci.org/nestjs/nest.svg?branch=master\" alt=\"Travis\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://travis-ci.org/nestjs/nest\"\u003e\u003cimg src=\"https://img.shields.io/travis/nestjs/nest/master.svg?label=linux\" alt=\"Linux\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://coveralls.io/github/nestjs/nest?branch=master\"\u003e\u003cimg src=\"https://coveralls.io/repos/github/nestjs/nest/badge.svg?branch=master#5\" alt=\"Coverage\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://gitter.im/nestjs/nestjs?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=body_badge\"\u003e\u003cimg src=\"https://badges.gitter.im/nestjs/nestjs.svg\" alt=\"Gitter\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/nest#backer\"\u003e\u003cimg src=\"https://opencollective.com/nest/backers/badge.svg\" alt=\"Backers on Open Collective\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/nest#sponsor\"\u003e\u003cimg src=\"https://opencollective.com/nest/sponsors/badge.svg\" alt=\"Sponsors on Open Collective\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://paypal.me/kamilmysliwiec\"\u003e\u003cimg src=\"https://img.shields.io/badge/Donate-PayPal-dc3d53.svg\"/\u003e\u003c/a\u003e\n  \u003ca href=\"https://twitter.com/nestframework\"\u003e\u003cimg src=\"https://img.shields.io/twitter/follow/nestframework.svg?style=social\u0026label=Follow\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n  \u003c!--[![Backers on Open Collective](https://opencollective.com/nest/backers/badge.svg)](https://opencollective.com/nest#backer)\n  [![Sponsors on Open Collective](https://opencollective.com/nest/sponsors/badge.svg)](https://opencollective.com/nest#sponsor)--\u003e\n\n## Description\n\nNodemailer utilities module for [Nest](https://github.com/nestjs/nest) based on the [nodemailer](https://github.com/nodemailer/nodemailer) package.\n\n## Installation\n\n```bash\n$ npm i --save @iaminfinity/nodemailer\n```\n## Usage\n\nImport `NodemailerModule`:\n\n```typescript\n@Module({\n  imports: [\n    NodemailerModule.register({\n      host: 'smtp.example.com',\n      port: 587,\n      secure: false,\n      auth: {\n          user: 'username',\n          pass: 'password'\n      }\n    })\n  ],\n  providers: [...]\n})\nexport class AppModule {}\n```\n\nInject `NodemailerService`:\n\n```typescript\n@Injectable()\nexport class AppService {\n  constructor(private readonly nodemailerService: NodemailerService) {}\n}\n```\n\n## Async options\n\nQuite often you might want to asynchronously pass your module options instead of passing them beforehand. In such case, use registerAsync() method, that provides a couple of various ways to deal with async data.\n\n**1. Use factory**\n\n```typescript\nNodemailerModule.registerAsync({\n  useFactory: () =\u003e ({\n    host: 'smtp.example.com',\n    port: 587,\n    secure: false,\n    auth: {\n        user: 'username',\n        pass: 'password'\n    }\n  })\n})\n```\n\nObviously, our factory behaves like every other one (might be `async` and is able to inject dependencies through `inject`).\n\n```typescript\nNodemailerModule.registerAsync({\n  imports: [ConfigModule],\n  useFactory: async (configService: ConfigService) =\u003e configService.getMailConfig(),\n  inject: [ConfigService],\n})\n```\n\n**2. Use class**\n\n```typescript\nNodemailerModule.registerAsync({\n  useClass: NodemailerConfigService\n})\n```\n\nAbove construction will instantiate `JwtConfigService` inside `JwtModule` and will leverage it to create options objec\n\n```typescript\nclass NodemailerConfigService implements NodemailerOptionsFactory {\n  createNodemailerOptions(): NodemailerModuleOptions {\n    return {\n      host: 'smtp.example.com',\n      port: 587,\n      secure: false,\n      auth: {\n        user: 'username',\n        pass: 'password'\n      }\n    };\n  }\n}\n```\n\n**3. Use existing**\n\n```typescript\nNodemailerModule.registerAsync({\n  imports: [ConfigModule],\n  useExisting: ConfigService\n})\n```\n\nIt works the same as `useClass` with one critical difference - `NodemailerModule` will lookup imported modules to reuse already created ConfigService, instead of instantiating it on its own.\n\n## Stay in touch\n\n- Author - [Fahim Rahman](https://github.com/ifaim)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fifaim%2Fnestjs-nodemailer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fifaim%2Fnestjs-nodemailer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fifaim%2Fnestjs-nodemailer/lists"}