{"id":24375977,"url":"https://github.com/betaweb/mailr","last_synced_at":"2026-04-20T22:31:18.857Z","repository":{"id":57291053,"uuid":"106713134","full_name":"betaWeb/mailr","owner":"betaWeb","description":"Fluent mail library for NodeJS","archived":false,"fork":false,"pushed_at":"2018-03-11T11:37:17.000Z","size":1461,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-09T13:35:05.362Z","etag":null,"topics":["email","email-sender","fluent","nodejs"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/betaWeb.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":"2017-10-12T15:44:58.000Z","updated_at":"2020-12-23T22:57:59.000Z","dependencies_parsed_at":"2022-09-01T15:20:38.105Z","dependency_job_id":null,"html_url":"https://github.com/betaWeb/mailr","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/betaWeb%2Fmailr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/betaWeb%2Fmailr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/betaWeb%2Fmailr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/betaWeb%2Fmailr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/betaWeb","download_url":"https://codeload.github.com/betaWeb/mailr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243215464,"owners_count":20255174,"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","email-sender","fluent","nodejs"],"created_at":"2025-01-19T05:58:57.010Z","updated_at":"2025-12-26T23:00:14.021Z","avatar_url":"https://github.com/betaWeb.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mailr\n## A fluent mail library for NodeJS based on [Nodemailer](https://github.com/nodemailer/nodemailer)\n\nThe goal of Mailr is simple : create and send emails by fluent-way with NodeJS.\n\n\u003cbr\u003e\n\n### Basic example :\n#### NodeJS :\n```javascript\nconst Mailr = require('Mailr')\n\n// Example with Gmail SMTP service\nconst mailr = new Mailr({\n    transporter_options: {\n        service: 'gmail',\n        port: 465,\n        secure: true,\n        host: 'smtp.gmail.com',\n        auth: {\n            user: 'email.address@gmail.com', // Here your Gmail address\n            pass: 'mysecurepassword'         // Here your Gmail password\n        }\n    }\n})\n\nmailr\n    .createMessage()\n    .from('no-reply@local.dev')\n    .to('receiver@domain.com')\n    .subject('Mailr is awesome !')\n    .template('my_awesome_template.njk')\n    .params({\n        title: 'Mail sended with Mailr',\n        content: 'This email has been sended with Mailr lib, and it \"roxx du poney\" !'\n    })\n    .send()\n    .then(_ =\u003e console.log('Email sended'))\n    .catch(console.error)\n``` \n#### Template (with [Nunjucks](https://mozilla.github.io/nunjucks/) by default) :\n```HTML\n\u003chtml\u003e\n    \u003chead\u003e\n        \u003cmeta charset=\"utf8\"\u003e\n    \u003c/head\u003e\n    \u003cbody\u003e\n        \u003ch1\u003e{{ title }}\u003c/h1\u003e\n        \u003cp\u003e{{ content }}\u003c/p\u003e\n    \u003c/body\u003e\n\u003c/html\u003e\n```\n\n\n### Example with attachment :\n#### NodeJS :\n```javascript\nconst options = {\n    mailer: {\n        template_path: './templates',\n        transporter_options: {\n            service: 'gmail',\n            port: 465,\n            secure: true,\n            host: 'smtp.gmail.com',\n            auth: {\n                user: 'email.address@gmail.com', // Here your Gmail address\n                pass: 'mysecurepassword'         // Here your Gmail password\n            }\n        }\n    },\n    message: {\n        default_from: 'No-reply \u003cno-reply@local.dev\u003e'\n    } \n}\n\nconst email = new Mailr(options).createMessage()\nconst message = email\n    .template('tpl_name')\n    .to('contact@local.dev')\n    .subject('My awesome email with attachment')\n    .attachment(\n        'path/to/attachment.pdf',           // Path to attachment file\n        'My PDF file',                      // Attachment name\n        { contentType: 'application/pdf' }  // Attachment options\n    )\n    .params({\n        title: 'This PDF file rocks !',\n        content: 'Look at this awesome attachment dude !'\n    })\n\nmessage.send()\n    .then(_ =\u003e console.log('Email sended with attachment'))\n    .catch(console.error)\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbetaweb%2Fmailr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbetaweb%2Fmailr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbetaweb%2Fmailr/lists"}