{"id":19010302,"url":"https://github.com/railsware/mailtrap-nodejs","last_synced_at":"2025-04-12T18:52:11.586Z","repository":{"id":37486524,"uuid":"503023905","full_name":"railsware/mailtrap-nodejs","owner":"railsware","description":"Official mailtrap.io Node.js client","archived":false,"fork":false,"pushed_at":"2025-02-28T17:22:29.000Z","size":436,"stargazers_count":73,"open_issues_count":0,"forks_count":8,"subscribers_count":19,"default_branch":"main","last_synced_at":"2025-04-04T00:29:46.434Z","etag":null,"topics":["email","javascript","mail","mailtrap-io","nodejs","typescript"],"latest_commit_sha":null,"homepage":"https://mailtrap.io","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/railsware.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-06-13T16:00:30.000Z","updated_at":"2025-03-26T17:31:42.000Z","dependencies_parsed_at":"2023-12-09T11:25:00.294Z","dependency_job_id":"76cb1459-5be2-4125-b541-d315a93a7f84","html_url":"https://github.com/railsware/mailtrap-nodejs","commit_stats":{"total_commits":241,"total_committers":12,"mean_commits":"20.083333333333332","dds":0.3609958506224067,"last_synced_commit":"1f9b0ea116db204e19873a07360f41461bec2e46"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/railsware%2Fmailtrap-nodejs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/railsware%2Fmailtrap-nodejs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/railsware%2Fmailtrap-nodejs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/railsware%2Fmailtrap-nodejs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/railsware","download_url":"https://codeload.github.com/railsware/mailtrap-nodejs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248618229,"owners_count":21134200,"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","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":["email","javascript","mail","mailtrap-io","nodejs","typescript"],"created_at":"2024-11-08T19:10:47.848Z","updated_at":"2025-04-12T18:52:11.547Z","avatar_url":"https://github.com/railsware.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![TypeScript](https://img.shields.io/npm/types/mailtrap?logo=typescript\u0026logoColor=white\u0026label=%20)\n[![test](https://github.com/railsware/mailtrap-nodejs/actions/workflows/test.yml/badge.svg)](https://github.com/railsware/mailtrap-nodejs/actions/workflows/test.yml)\n[![NPM](https://shields.io/npm/v/mailtrap?logo=npm\u0026logoColor=white)](https://www.npmjs.com/package/mailtrap)\n[![downloads](https://shields.io/npm/d18m/mailtrap)](https://www.npmjs.com/package/mailtrap)\n\n# Official Mailtrap Node.js client\n\nThis NPM package offers integration with the [official API](https://api-docs.mailtrap.io/) for [Mailtrap](https://mailtrap.io).\n\nQuickly add email sending functionality to your Node.js application with Mailtrap.\n\n## Installation\n\nUse yarn or npm to install the package:\n\n```sh\nyarn add mailtrap\n\n# or, if you are using NPM:\nnpm install mailtrap\n```\n\n## Usage\n\n### Minimal\n\n```ts\nimport { MailtrapClient } from \"mailtrap\"\n\n/**\n * For this example to work, you need to set up a sending domain,\n * and obtain a token that is authorized to send from the domain.\n */\n\nconst TOKEN = \"\u003cYOUR-TOKEN-HERE\u003e\";\nconst SENDER_EMAIL = \"\u003cSENDER@YOURDOMAIN.COM\u003e\";\nconst RECIPIENT_EMAIL = \"\u003cRECIPIENT@EMAIL.COM\u003e\";\n\nconst client = new MailtrapClient({ token: TOKEN });\n\nconst sender = { name: \"Mailtrap Test\", email: SENDER_EMAIL };\n\nclient\n  .send({\n    from: sender,\n    to: [{ email: RECIPIENT_EMAIL }],\n    subject: \"Hello from Mailtrap!\",\n    text: \"Welcome to Mailtrap Sending!\",\n  })\n  .then(console.log)\n  .catch(console.error);\n```\n\nRefer to the [`examples`](examples) folder for the source code of this and other advanced examples.\n\n### General API\n\n - [List User \u0026 Invite account accesses](examples/general/account-accesses.ts)\n - [Remove account access](examples/general/accounts.ts)\n - [Permissions](examples/general/permissions.ts)\n\n### Sending API\n\n - [Advanced](examples/sending/everything.ts)\n - [Minimal](examples/sending/minimal.ts)\n - [Send email using template](examples/sending/template.ts)\n - [Nodemailer transport](examples/sending/transport.ts)\n\n### Email testing API\n\n - [Attachments](examples/testing/attachments.ts)\n - [Inboxes](examples/testing/inboxes.ts)\n - [Messages](examples/testing/messages.ts)\n - [Projects](examples/testing/projects.ts)\n - [Send mail using template](examples/testing/template.ts)\n\n### Bulk sending API\n\n - [Send mail](examples/bulk/send-mail.ts)\n\n### Nodemailer Transport\n\n\u003e NOTE: [Nodemailer](https://www.npmjs.com/package/nodemailer) is needed as a dependency.\n\n```sh\nyarn add nodemailer\n\n# or, if you are using NPM:\nnpm install --s nodemailer\n```\n\nIf you're using Typescript, install `@types/nodemailer` as a `devDependency`.\n\n```sh\nyarn add --dev @types/nodemailer\n\n# or, if you are using NPM:\nnpm install --s-dev @types/nodemailer\n\nYou can provide Mailtrap specific keys like `category`, `customVariables`, `templateUuid` and `templateVariables`.\n\n```\nSee transport usage below:\n\n - [Transport](examples/sending/transport.ts)\n\n## Development\n\nThis library is developed using [TypeScript](https://www.typescriptlang.org).\n\nUse `yarn lint` to perform linting with [ESLint](https://eslint.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on [GitHub](https://github.com/railsware/mailtrap-nodejs). This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](CODE_OF_CONDUCT.md).\n\n## License\n\nThe package is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n## Code of Conduct\n\nEveryone interacting in the Mailtrap project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](CODE_OF_CONDUCT.md).\n\n## Compatibility with previous releases\n\nVersions of this package up to 2.0.2 were an [unofficial client](https://github.com/vchin/mailtrap-client) developed by [@vchin](https://github.com/vchin). Package version 3 is a completely new package. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frailsware%2Fmailtrap-nodejs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frailsware%2Fmailtrap-nodejs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frailsware%2Fmailtrap-nodejs/lists"}