{"id":17458107,"url":"https://github.com/pocesar/node-aws-mjml-csv","last_synced_at":"2025-03-21T03:33:32.740Z","repository":{"id":138844232,"uuid":"117091388","full_name":"pocesar/node-aws-mjml-csv","owner":"pocesar","description":"CLI and programatic API to send emails using MJML (that is then parsed by Handlebars.js), populating your email passing the CSV columns to your template","archived":false,"fork":false,"pushed_at":"2018-01-14T14:05:28.000Z","size":14,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-18T06:27:56.127Z","etag":null,"topics":["aws","aws-ses","cli","csv-columns","handlebars","mailer","mjml","nodejs","template","typescript"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/pocesar.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-11T11:29:18.000Z","updated_at":"2021-09-13T21:54:28.000Z","dependencies_parsed_at":"2023-03-17T23:15:17.695Z","dependency_job_id":null,"html_url":"https://github.com/pocesar/node-aws-mjml-csv","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pocesar%2Fnode-aws-mjml-csv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pocesar%2Fnode-aws-mjml-csv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pocesar%2Fnode-aws-mjml-csv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pocesar%2Fnode-aws-mjml-csv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pocesar","download_url":"https://codeload.github.com/pocesar/node-aws-mjml-csv/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243822294,"owners_count":20353500,"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":["aws","aws-ses","cli","csv-columns","handlebars","mailer","mjml","nodejs","template","typescript"],"created_at":"2024-10-18T03:54:27.885Z","updated_at":"2025-03-21T03:33:32.484Z","avatar_url":"https://github.com/pocesar.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/pocesar/node-aws-mjml-csv.svg?branch=master)](https://travis-ci.org/pocesar/node-aws-mjml-csv)\n[![npm version](https://badge.fury.io/js/aws-mjml-csv.svg)](https://badge.fury.io/js/aws-mjml-csv)\n[![Coverage Status](https://coveralls.io/repos/github/pocesar/node-aws-mjml-csv/badge.svg?branch=master)](https://coveralls.io/github/pocesar/node-aws-mjml-csv?branch=master)\n\n# aws-mjml-csv\n\nCLI and programatic API to send emails using MJML (that is then parsed by Handlebars.js), populating your email passing the CSV columns to your template. Will try to throttle according to your current limits.\n\n## Why\n\nSending email using an interface is great if you don't know what you're doing. You have a nice WYSIWYG interface, some drag'n'drop widgets, and a shiny file manager. Emails this way are ok, but usually you'll want something more solid, giving your designer to use MJML instead, using Handlebars inside your MJML template, and create a nice professional responsive look and \"feels like home\" emails crafted to customers. For that templating capabilities you'll have to resort to paid services, like Mailchimp or Sendgrid, using their templating language. This is a really cost effective alternative (plus 62k free emails per month on AWS).\n\nPass as many variables that are important using CSV, slap in a template using `.mjml` file, and you're ready to go\n\n## How\n\nInstall it globally or locally using:\n\n```bash\nnpm i aws-mjml-csv -g\n```\n\nYou can either send it immediately using the command line like so:\n\n```bash\n~$ aws-mjml-csv --source example@example.com --subject \"Hello {{ name }}\" --csv /path/to/contacts.csv --dry-run --template /path/to/template.mjml\n```\n\nor in your code:\n\n```ts\nimport { SendEmail } from 'aws-mjml-csv'\nimport * as AWS from 'aws-sdk'\n\nconst instance = new SendEmail({\n  source: 'example@example.com'\n})\n\n(async () =\u003e {\n  await instance.setMjml('./template.mjml')\n  await instance.setCsvfromPath('./contacts.csv')\n\n  let sent = 0\n  let errors = 0\n\n  instance.on('sent', ({ result, row, time }: { time: number, result: AWS.SES.Types.SendEmailResponse, row: Object }) =\u003e {\n    sent++\n  })\n\n  instance.on('error', ({ error, row, time }: { time: number, error: AWS.AWSError, row: Object }) =\u003e {\n    errors++\n  })\n\n  await instance.send()\n\n  console.log(`Sent ${sent} emails (${error} failed)`)\n})()\n```\n\nIf you are in a sandbox for SES, you'll be able to send 1 email per second, up to 1000. This module will throttle the sending depending on your quota.\n\nNotice that you need at least one column called `email`. AWS configuration are either done using credentials on the machine or using environment variables, check [AWS documentation](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html) for that. Remember to set `AWS_DEFAULT_REGION`, `AWS_SECRET_ACCESS_KEY` and `AWS_ACCESS_KEY_ID`\n\n## Caveats\n\nAlthough `csv-parser` is really performant and it's a stream, depending on the size of your email list, node.js might reach it's max memory waiting for SES.\n\n## License\n\nMIT\n\n## Development\n\n* BTC: `16QDbqa6UMFtMCdDcJJ5N2bqryH4Q56BVU`\n* BCH: `1E6gKfkyxsjr2rSbcHbnfsQumKxkGKwRYc`\n* ETH: `0xfF9087E7112d3b7D7B5bDD6C9ffb0970ACC162E7`\n* MIOTA: `NNIH9VGEQFZAJIITBO9FEDSYUDYXHMAINGSKWIU9ADUHYYNTIYGJADZITOCVMWEFTKJGCNCJN9ZRFUZKCPSUOMDAKD`\n* NXT: `NXT-7TJT-8NS2-8QBS-5Y89X`\n* BTG: `GY2RWXUKYDmYDaroMmucgUdF7dLqaHDKWu`\n* XEM: `NBC772-Q3SL4X-AGVNMP-JAWGJE-U6BCSB-Q7WNAX-YU5V`\n* DASH: `XaqxcT3BDmSLGB4M6ozrET1qJPBA4RJpng`\n* XRB: `xrb_3fi16pk4gyz331r4531m7jywrfsgp3h31yoyfusac77esuamh65r5kwjz7dm`","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpocesar%2Fnode-aws-mjml-csv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpocesar%2Fnode-aws-mjml-csv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpocesar%2Fnode-aws-mjml-csv/lists"}