{"id":15063402,"url":"https://github.com/voidnerd/node-mail-helper","last_synced_at":"2026-01-02T13:53:41.022Z","repository":{"id":51403329,"uuid":"277943197","full_name":"voidnerd/node-mail-helper","owner":"voidnerd","description":"Nodemailer Helper For Sending Emails With Ejs Templating.","archived":false,"fork":false,"pushed_at":"2021-05-12T01:22:33.000Z","size":10,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-23T14:49:01.016Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/voidnerd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-07T23:28:41.000Z","updated_at":"2020-07-08T07:42:34.000Z","dependencies_parsed_at":"2022-09-11T17:00:54.968Z","dependency_job_id":null,"html_url":"https://github.com/voidnerd/node-mail-helper","commit_stats":null,"previous_names":["ndiecodes/node-mail-helper"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voidnerd%2Fnode-mail-helper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voidnerd%2Fnode-mail-helper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voidnerd%2Fnode-mail-helper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voidnerd%2Fnode-mail-helper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/voidnerd","download_url":"https://codeload.github.com/voidnerd/node-mail-helper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243761661,"owners_count":20343937,"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":[],"created_at":"2024-09-24T23:56:19.999Z","updated_at":"2026-01-02T13:53:40.974Z","avatar_url":"https://github.com/voidnerd.png","language":"JavaScript","readme":"# Node-Mail-Helper\n\nNodemailer Helper For Sending Emails With Ejs Templating.\n\n## Installation\n\n```\nnpm install node-mail-helper\n```\n\n## Prerequisite\n\nThis package requires the following env variables.\n\n```python\nMAIL_DRIVER=smtp\nMAIL_HOST=smtp.mailtrap.io\nMAIL_PORT=2525\nMAIL_USERNAME=xxxxxxxxxxx\nMAIL_PASSWORD=xxxxxxxxxxx\nMAIL_ENCRYPTION=\nMAIL_FROM=no-reply@ndiecodes.com\n```\n\nN/B: MAIL_ENCRYPTION should be `tls` or `ssl` for secure channels and `blank` for unsecure channels.\n\n## Usage\n\n```js\nconst Mail = require(\"node-mail-helper\");\nconst path = require(\"path\");\n\nconst mailData = {\n    name: \"Ndifreke Friday\",\n    city: \"Lagos\"\n}\n\nconst templatePath = path.join(__dirname, \"./emails/welcome.ejs\");\n\nconst mail = new Mail();\n await mail\n      .to(user.email)\n      .template(templatePath) //full path to your ejs file\n      .subject(\"Welcome Email\")\n      .data(mailData)\n      .send();\n```\n\n### The bellow example has all available methods\n\n```js\nconst Mail = require(\"node-mail-helper\");\nconst path = require(\"path\");\n\nconst mailData = {\n    name: \"Ndifreke Friday\",\n    city: \"Lagos\"\n}\n\nconst templatePath = path.join(__dirname, \"./emails/welcome.ejs\");\n\nconst attactments = [\n        {   // utf-8 string as an attachment\n            filename: 'text1.txt',\n            content: 'hello world!'\n        },\n        {   // binary buffer as an attachment\n            filename: 'text2.txt',\n            content: new Buffer('hello world!','utf-8')\n        },\n];\n\nconst mail = new Mail();\n await mail\n      .from(\"no-reply@ndiecodes.com\")\n      .to(user.email)\n      .cc(\"janedoe@gmail.com\")\n      .bcc(\"johndoe@gmail.com\")\n      .text(\"String Represenation of Email Body\")\n      .template(templatePath)\n      .subject(\"Welcome Email\")\n      .attachments(attachments)\n      .data(mailData)\n      .send();\n```\n## License\n\nMIT","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvoidnerd%2Fnode-mail-helper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvoidnerd%2Fnode-mail-helper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvoidnerd%2Fnode-mail-helper/lists"}