{"id":19232654,"url":"https://github.com/makeomatic/ms-mailer-client","last_synced_at":"2025-10-07T06:33:09.614Z","repository":{"id":2202053,"uuid":"45935952","full_name":"makeomatic/ms-mailer-client","owner":"makeomatic","description":"Encapsulates routes and provides convenience methods to send emails","archived":false,"fork":false,"pushed_at":"2024-01-20T17:57:37.000Z","size":555,"stargazers_count":0,"open_issues_count":20,"forks_count":1,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-02-05T14:08:02.868Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/makeomatic.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-11-10T19:42:59.000Z","updated_at":"2023-01-31T18:41:51.000Z","dependencies_parsed_at":"2025-01-05T00:26:23.059Z","dependency_job_id":"203783a9-dbff-4d47-85e5-f99f0c09615a","html_url":"https://github.com/makeomatic/ms-mailer-client","commit_stats":{"total_commits":27,"total_committers":5,"mean_commits":5.4,"dds":0.5185185185185186,"last_synced_commit":"02718fbe941f4025340272255f7f5b3a23bb34cd"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makeomatic%2Fms-mailer-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makeomatic%2Fms-mailer-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makeomatic%2Fms-mailer-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makeomatic%2Fms-mailer-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/makeomatic","download_url":"https://codeload.github.com/makeomatic/ms-mailer-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240310872,"owners_count":19781341,"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-11-09T16:07:06.069Z","updated_at":"2025-10-07T06:33:04.580Z","avatar_url":"https://github.com/makeomatic.png","language":"JavaScript","readme":"# Mailer microservice client\n\nEncapsulates raw AMQP methods into a convenience wrapper.\n\n## Installation\n\n`npm i ms-mailer-client -S`\n\n## Usage\n\n```js\nconst Mailer = require('ms-mailer-client');\n\nconst mailer = new Mailer(amqpTransport, {\n  prefix: 'mailer',\n  routes: {\n    adhoc: 'adhoc',\n    predefined: 'predefined'\n  }\n});\n\n// use predefined email\nconst promisePredefined = mailer.send('support@makeomatic.ru', {\n  // email body with nodemailer\n});\n\n// use adhoc account\nconst promiseAdhoc = mailer.send({\n  // nodemailer smtp data\n  service: 'gmail',\n  auth: {\n\n  }\n}, {\n  // nodemailer email body\n});\n```\n\n### `send` method\n\n```js\nconst Mailer = require('ms-mailer-client');\nconst mailer = new Mailer(transport, { /* config */ });\n\nconst promise = mailer.send('support@makeomatic.ru', {\n  // nodemailer email body\n  from: 'support@makeomatic.ru',\n  to: 'test@example.com',\n  subject: 'subj',\n  text: 'some text',\n  html: '\u003cp\u003ehtml version of some text\u003c/p\u003e',\n});\n\n```\n\n### `sendTemplate` method\n\n```js\nconst Mailer = require('ms-mailer-client');\nconst mailer = new Mailer(transport, { /* config */ });\n\n// can be used with adhoc account setup aswell\nconst promise = mailer.sendTemplate(\n  'support@makeomatic.ru', \n  'reset', // template name\n  {\n    nodemailer: {\n      from: 'support@makeomatic.ru',\n      to: 'test@example.com',\n      subject: 'subj',\n    },\n    ctx: {\n      // template rendering context\n      link: 'activation_link',\n      name: 'John Doe',\n    },\n  }\n);\n```\n\nResulted promise can be fulfilled with rejection when\nthe requested template name does not exist. \n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmakeomatic%2Fms-mailer-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmakeomatic%2Fms-mailer-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmakeomatic%2Fms-mailer-client/lists"}