{"_id":"@b-stable/nodemailer-mailgun-transport-ts","name":"@b-stable/nodemailer-mailgun-transport-ts","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@b-stable/nodemailer-mailgun-transport-ts","version":"1.0.0","description":"Mailgun transport for the nodemailer library","main":"./lib/index.js","scripts":{"build":"tsc --project tsconfig.build.json","clean":"rm -rf ./lib/","cm":"cz","lint":"eslint ./src/ --fix","prepare":"husky install","semantic-release":"semantic-release","test:watch":"jest --watch","test":"jest --coverage","typecheck":"tsc --noEmit"},"license":"MIT","engines":{"node":">=12.0"},"devDependencies":{"@ryansonshine/commitizen":"^4.2.8","@ryansonshine/cz-conventional-changelog":"^3.3.4","@types/jest":"^27.5.2","@types/node":"^12.20.11","@typescript-eslint/eslint-plugin":"^4.22.0","@typescript-eslint/parser":"^4.22.0","conventional-changelog-conventionalcommits":"^5.0.0","eslint":"^7.25.0","eslint-config-prettier":"^8.3.0","eslint-plugin-node":"^11.1.0","eslint-plugin-prettier":"^3.4.0","husky":"^6.0.0","jest":"^27.2.0","lint-staged":"^13.2.1","prettier":"^2.2.1","semantic-release":"^21.0.1","ts-jest":"^27.0.5","ts-node":"^10.2.1","typescript":"^4.2.4"},"config":{"commitizen":{"path":"./node_modules/@ryansonshine/cz-conventional-changelog"}},"lint-staged":{"*.ts":"eslint --cache --cache-location .eslintcache --fix"},"release":{"branches":["main"],"plugins":[["@semantic-release/commit-analyzer",{"preset":"conventionalcommits","releaseRules":[{"type":"build","scope":"deps","release":"patch"}]}],["@semantic-release/release-notes-generator",{"preset":"conventionalcommits","presetConfig":{"types":[{"type":"feat","section":"Features"},{"type":"fix","section":"Bug Fixes"},{"type":"build","section":"Dependencies and Other Build Updates","hidden":false}]}}],"@semantic-release/npm","@semantic-release/github"]},"dependencies":{"@types/consolidate":"^0.14.1","@types/nodemailer":"^6.4.9","consolidate":"^1.0.1","form-data":"^4.0.0","mailgun.js":"^9.1.2","nodemailer":"^6.9.4"},"licenseText":"MIT License\n\nCopyright (c) 2023 BitSpectrum\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@b-stable/nodemailer-mailgun-transport-ts@1.0.0","dist":{"shasum":"92961671c2e1b6d7c63b97b9af6db1da0eca3b35","integrity":"sha512-KebyqkGsziVZRWd4gL2gSdc40gO/+pw7anhbAhc3uu4xWoxVnnvlbJRz4FZkJ8pTq/pPQugFaVFLAGJpWW81nw==","tarball":"https://registry.npmjs.org/@b-stable/nodemailer-mailgun-transport-ts/-/nodemailer-mailgun-transport-ts-1.0.0.tgz","fileCount":45,"unpackedSize":30527,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCzVuFwO/kE9U85M238ml1POyEtxmN456Jb6WRi8nVRagIhAJoI7IbCoVisyPUsMe1WAnR1jaRj4KdHrrAXj9T3DKCV"}]},"_npmUser":{"name":"ivonin","email":"d.ivonin@rebase.agency"},"directories":{},"maintainers":[{"name":"kaptn","email":"v.kapitonenko@rebase.agency"},{"name":"ivonin","email":"d.ivonin@rebase.agency"},{"name":"b-stable-team","email":"team.bstable@yahoo.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nodemailer-mailgun-transport-ts_1.0.0_1722247753770_0.15998740680450974"},"_hasShrinkwrap":false}},"time":{"created":"2024-07-29T10:09:13.624Z","1.0.0":"2024-07-29T10:09:14.015Z","modified":"2024-07-29T10:09:14.306Z"},"maintainers":[{"name":"kaptn","email":"v.kapitonenko@rebase.agency"},{"name":"ivonin","email":"d.ivonin@rebase.agency"},{"name":"b-stable-team","email":"team.bstable@yahoo.com"}],"description":"Mailgun transport for the nodemailer library","license":"MIT","readme":"## Installation\n\nTo use nodemailer-mailgun-transport, all you need to do is install the\n`@b-stable/nodemailer-mailgun-transport-ts` package\n\n```sh\n$ yarn add @b-stable/nodemailer-mailgun-transport-ts\n\n# or\n\n$ npm i @b-stable/nodemailer-mailgun-transport-ts\n```\n\n## Usage\n\n```ts\nimport nodemailer from 'nodemailer';\nimport { MailgunTransport } from '@b-stable/nodemailer-mailgun-transport-ts';\n\n// This is your options that you retrieve from www.mailgun.com\nconst options = {\n    auth: {\n        domain: 'domain-name',\n        api_key: '123456789',\n    },\n    host: 'api.mailgun.net',\n};\n\nconst nodemailerMailgun = nodemailer.createTransport(new MailgunTransport(options));\n\nnodemailerMailgun.sendMail({\n    from: 'myemail@example.com',\n    to: 'recipient@domain.com', // An array if you have multiple recipients.\n    cc:'second@domain.com',\n    bcc:'secretagent@company.gov',\n    subject: 'Hey you, awesome!',\n    'replyTo': 'reply2this@company.com',\n    //You can use \"html:\" to send HTML email content. It's magic!\n    html: '<b>Wow Big powerful letters</b>',\n    //You can use \"text:\" to send plain-text content. It's oldschool!\n    text: 'Mailgun rocks, pow pow!'\n}, (err, info) => {\n    if (err) {\n        console.log(`Error: ${err}`);\n    }\n    else {\n        console.log(`Response: ${info}`);\n    }\n});\n```\nThe \"from\", \"to\", \"cc\", and \"bcc\" fields support an address object or array of address objects. Each \"name\" and \n\"address\" are converted to ```\"name <address>\"``` format. \"name\" is optional, \"address\" is required. Missing or null \naddress in object is skipped.\n\nExample:\n```ts\n from: {name: 'Sales', address: 'sales@example.com'},\n to: [{name:'Mary', address:'mary@differentexample.com'}, {address:'john@anotherexample.com'}]\n```\nIs converted to:\n```ts\n from: 'Sales <sales@example.com>',\n to: 'Mary <mary@differentexample.com>,john@anotherexample.com'\n```\nTo use consolidate.js templates locally, give the template key an object instead that contains a name key, an \nengine key and, optionally, a context object. For example, you can use Handlebars templates to generate the \nHTML for your message like so:\n```ts\nconst contextObject = {\n  variable1: 'value1',\n  variable2: 'value2'\n};\n\nnodemailerMailgun.sendMail({\n  from: 'myemail@example.com',\n  to: 'recipient@domain.com', // An array if you have multiple recipients.\n  subject: 'Hey you, awesome!',\n  template: {\n    name: 'email.hbs',\n    engine: 'handlebars',\n    context: contextObject\n  }\n}, (err, info) => {\n  if (err) {\n    console.log(`Error: ${err}`);\n  }\n  else {\n    console.log(`Response: ${info}`);\n  }\n});\n```","readmeFilename":"README.md"}