{"id":21206950,"url":"https://github.com/paralect/email-service","last_synced_at":"2025-07-10T08:33:21.036Z","repository":{"id":55029068,"uuid":"135574670","full_name":"paralect/email-service","owner":"paralect","description":null,"archived":false,"fork":false,"pushed_at":"2021-01-14T11:06:40.000Z","size":21,"stargazers_count":4,"open_issues_count":1,"forks_count":2,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-10-31T18:59:21.292Z","etag":null,"topics":["email","email-sending","paralect-stack"],"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/paralect.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-31T11:28:07.000Z","updated_at":"2021-01-20T19:46:24.000Z","dependencies_parsed_at":"2022-08-14T09:31:15.058Z","dependency_job_id":null,"html_url":"https://github.com/paralect/email-service","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paralect%2Femail-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paralect%2Femail-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paralect%2Femail-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paralect%2Femail-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paralect","download_url":"https://codeload.github.com/paralect/email-service/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225629838,"owners_count":17499295,"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-sending","paralect-stack"],"created_at":"2024-11-20T20:57:19.014Z","updated_at":"2024-11-20T20:57:19.593Z","avatar_url":"https://github.com/paralect.png","language":"JavaScript","readme":"# Email service\n\n[![Stack](https://raw.githubusercontent.com/paralect/stack/master/stack-component-template/stack.png)](https://github.com/paralect/stack)\n\n[![All Contributors](https://img.shields.io/badge/all_contributors-2-orange.svg?style=flat-square)](#contributors)\n[![npm version](https://badge.fury.io/js/%40paralect%2Femail-service.svg)](https://badge.fury.io/js/%40paralect%2Femail-service) \n[![license](https://img.shields.io/github/license/mashape/apistatus.svg?style=flat-square)](LICENSE)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)\n[![Build Status](http://product-stack-ci.paralect.com/api/badges/paralect/email-service/status.svg)](http://product-stack-ci.paralect.com/paralect/email-sercice)\n[![David Dependancy Status](https://david-dm.org/paralect/email-service.svg)](https://david-dm.org/paralect/email-service)\n[![Coverage Status](https://coveralls.io/repos/github/paralect/email-service/badge.svg?branch=master)](https://coveralls.io/github/paralect/email-service?branch=master)\n\n\n[![Watch on GitHub](https://img.shields.io/github/watchers/paralect/email-service.svg?style=social\u0026label=Watch)](https://github.com/paralect/email-service/watchers)\n[![Star on GitHub](https://img.shields.io/github/stars/paralect/email-service.svg?style=social\u0026label=Stars)](https://github.com/paralect/email-service/stargazers)\n[![Follow](https://img.shields.io/twitter/follow/paralect.svg?style=social\u0026label=Follow)](https://twitter.com/paralect)\n[![Tweet](https://img.shields.io/twitter/url/https/github.com/paralect/stack.svg?style=social)](https://twitter.com/intent/tweet?text=I%27m%20using%20Stack%20components%20to%20build%20my%20next%20product%20🚀.%20Check%20it%20out:%20https://github.com/paralect/stack)\n\nEmail service is using [mailgun node client](https://www.npmjs.com/package/mailgun-js) to send emails.\nWe are inspired by [mjml](https://github.com/mjmlio/mjml) project. So, you can use mjml in your project and\nafter compiling templates to simple html files use our project to inject params by handlebars and send emails.\nLet's dive into the docs.\n\n## Installation\n\n```\nnpm i @paralect/email-service\n```\n\n## Quick example\n\nTo create a MailService class you should provide several params to its constructor\n```javascript\nconst MailService = require('@paralect/email-service');\n\nconst mailService = new MailService({\n  isSendEmail: false, // you can prevent email sending by this param\n  savedEmailHtmlPath: __dirname, // if you want to save your email as html in development mode\n  mailgun: {  // configs for https://www.npmjs.com/package/mailgun-js\n    apiKey: 'test',\n    domain: 'test.info',\n  },\n  templatesDir: __dirname, // absolute path to templates directory\n});\n```\n\nAfter that you are able to run **send** method with several params\n\n```javascript\nconst result = await mailService.send(\n  'email.html',\n  { name: 'User name' },\n  {\n    from: 'Excited User \u003cme@samples.mailgun.org\u003e',\n    to: 'test@test.com',\n    subject: 'Test email',\n  }\n);\n```\n\n## Full API Reference\n\n[API Reference](https://github.com/paralect/email-service/blob/master/API.md).\n\n## Change Log\n\nThis project adheres to [Semantic Versioning](http://semver.org/).\nEvery release is documented on the Github [Releases](https://github.com/paralect/email-service/releases) page.\n\n## License\n\nEmail-service is released under the [MIT License](https://github.com/paralect/email-service/blob/master/LICENSE).\n\n## Contributing\n\nPlease read [CONTRIBUTING.md](https://github.com/paralect/email-service/blob/master/CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.\n\n## Contributors\n\nThanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore --\u003e\n| [\u003cimg src=\"https://avatars3.githubusercontent.com/u/14125982?v=4\" width=\"100px;\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eKuhArt\u003c/b\u003e\u003c/sub\u003e](https://github.com/KuhArt)\u003cbr /\u003e[💻](https://github.com/paralect/email-service/commits?author=KuhArt \"Code\") [📖](https://github.com/paralect/email-service/commits?author=KuhArt \"Documentation\") [🤔](#ideas-KuhArt \"Ideas, Planning, \u0026 Feedback\") [🎨](#design-KuhArt \"Design\") | [\u003cimg src=\"https://avatars2.githubusercontent.com/u/6461311?v=4\" width=\"100px;\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eEvgeny Zhivitsa\u003c/b\u003e\u003c/sub\u003e](https://github.com/ezhivitsa)\u003cbr /\u003e[💻](https://github.com/paralect/email-service/commits?author=ezhivitsa \"Code\") [📖](https://github.com/paralect/email-service/commits?author=ezhivitsa \"Documentation\") |\n| :---: | :---: |\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome!\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparalect%2Femail-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparalect%2Femail-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparalect%2Femail-service/lists"}