{"id":20607114,"url":"https://github.com/kbarbounakis/most-web-mailer","last_synced_at":"2025-04-15T02:45:08.306Z","repository":{"id":1599893,"uuid":"43049117","full_name":"kbarbounakis/most-web-mailer","owner":"kbarbounakis","description":"Most Web Framework Mailer Module","archived":false,"fork":false,"pushed_at":"2023-01-08T17:11:15.000Z","size":152,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-15T02:45:02.853Z","etag":null,"topics":["data","mail","mail-templates","mailer","send","web-mailer"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kbarbounakis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-09-24T06:30:11.000Z","updated_at":"2022-05-04T06:42:56.000Z","dependencies_parsed_at":"2023-01-13T11:15:06.651Z","dependency_job_id":null,"html_url":"https://github.com/kbarbounakis/most-web-mailer","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/kbarbounakis%2Fmost-web-mailer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kbarbounakis%2Fmost-web-mailer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kbarbounakis%2Fmost-web-mailer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kbarbounakis%2Fmost-web-mailer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kbarbounakis","download_url":"https://codeload.github.com/kbarbounakis/most-web-mailer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248997087,"owners_count":21195797,"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":["data","mail","mail-templates","mailer","send","web-mailer"],"created_at":"2024-11-16T09:35:36.031Z","updated_at":"2025-04-15T02:45:08.284Z","avatar_url":"https://github.com/kbarbounakis.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @themost/mailer\n\n[Most Web Framework](https://github.com/themost-framework/themost) Mailer simplifies mail operations by sending either static or dynamic html emails.\n\nInstall with npm\n\n    npm install @themost/mailer\n    \n\nUse `@themost/mailer` to send static html emails:\n\n    import {MailHelper} from '@themost/mailer';\n    // init mail in the current HTTP context\n    new MailHelper(context).transporter({\n        service:'gmail',\n        auth:{\n            user:\"user@example.com\",\n            pass:\"password\"\n        }\n    }).from('user@example.com')\n        .to('friend@example.com')\n        .subject('Hello from user')\n        .body('\u003cp style=\"color:#0040D0\"\u003eHello World\u003c/p\u003e').send({}, function(err) {\n            done(err);\n        });\n    \nYou can use default mail transporter as it is defined in application configuration section settings#mail. In this case you can omit transporter initialization. e.g.\n\n    ...\n    \"settings\": {\n      ...\n      \"mail\": {\n          \"from\": \"user@example.com\"\n          \"port\":587,\n          \"host\":\"smtp.example.com\",\n          \"auth\": {\n            \"user\":\"user@example.com\",\n            \"pass\":\"password\"\n          }\n      }\n      ...\n    }\n    \nNote: MOST Web Framework Mailer uses [nodemailer](https://github.com/andris9/Nodemailer) as sender engine.\n\nMOST Web Framework Mailer gives you also the opportunity to send dynamic mail templates by using the registered view engines. So, create a folder in app/templates/mails directory\n\n    + app\n      + templates\n        + mails\n          + my-first-template\n\nCreate a file named html.ejs (Note: EJS is the default view engine for every MOST Web Framework application):\n\n    \u003chtml\u003e\n      \u003chead\u003e\n          \u003clink rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.2/css/bootstrap.css\" /\u003e\n      \u003c/head\u003e\n      \u003cbody\u003e\n            \u003cdiv class=\"page-header\"\u003e\n                \u003ch1\u003eMOST Web Framework Team\u003c/h1\u003e\n            \u003c/div\u003e\n            \u003cp\u003eHello \u003c%=model.name%\u003e\u003c/p\u003e\n        \u003c/body\u003e\n    \u003c/html\u003e\n\nFinally, send dynamic mail template:\n\n    import {MailHelper} from '@themost/mailer';\n    // init mail in the current HTTP context\n    new MailHelper(context).from('user@example.com')\n        .to('friend@example.com')\n        .subject('Hello from user')\n        .template('my-first-template').send({ name: 'George' }, (err) =\u003e {\n            done(err);\n        });\n    \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkbarbounakis%2Fmost-web-mailer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkbarbounakis%2Fmost-web-mailer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkbarbounakis%2Fmost-web-mailer/lists"}