{"id":18548853,"url":"https://github.com/brianyu28/dispatch","last_synced_at":"2025-04-09T21:32:23.731Z","repository":{"id":46994614,"uuid":"101514881","full_name":"brianyu28/dispatch","owner":"brianyu28","description":"A command-line tool for sending parameterized emails","archived":false,"fork":false,"pushed_at":"2024-04-18T04:30:57.000Z","size":55,"stargazers_count":39,"open_issues_count":0,"forks_count":14,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-24T11:56:51.669Z","etag":null,"topics":["automation","email"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brianyu28.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":"2017-08-26T21:43:51.000Z","updated_at":"2024-08-02T17:44:42.000Z","dependencies_parsed_at":"2024-04-18T05:43:35.301Z","dependency_job_id":null,"html_url":"https://github.com/brianyu28/dispatch","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianyu28%2Fdispatch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianyu28%2Fdispatch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianyu28%2Fdispatch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianyu28%2Fdispatch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brianyu28","download_url":"https://codeload.github.com/brianyu28/dispatch/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248114829,"owners_count":21050125,"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":["automation","email"],"created_at":"2024-11-06T20:35:57.222Z","updated_at":"2025-04-09T21:32:23.433Z","avatar_url":"https://github.com/brianyu28.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dispatch\n\nA command-line tool for sending parameterized emails\n\n## Usage\n\nGenerate a new email configuration with:\n\n```\n$ dispatch generate\n```\n\nThe `generate` command will prompt for information and then create the following\nfiles:\n\n- The **configuration file** is a JSON file containing the information needed to\ngenerate and send email: the sender's name, address, email server; the to, cc,\nand bcc fields; the subject line; and paths to the body and data files.\n- The **body file** is a file containing the body of the email. It can\noptionally contain parameters of the form `{varname}` that will be substituted\nduring dispatch. The body can be a single HTML file, a single text file,\nor both an HTML file and a text file for a `multipart/alternative` email.\n- The **data file** is a CSV file containing the data for the emails to send. A\nheader row is required: it should specify one column for each of the `{varname}`\nparameters present in the email body or sender/recipient addresses. The data file\nshould then include one row for each email to be sent.\n\nOnce the emails are configured, send them with:\n\n```\n$ dispatch send \u003cCONFIG_PATH\u003e\n```\n\nThe `send` command will prompt you for an email password and then send the\nemails.\n\nOptionally, add the `--dry-run` flag to view the contents of the emails before\nsending them.\n\n## Installation\n\nTo build and install from source (requires Rust 1.60 or newer):\n\n```\n$ cargo install --path .\n```\n\n## Configuration\n\n### Configuration File\n\nThe configuration file is a JSON file (called `config.json` by default). The\nfile can have the following fields:\n\n- `username`: The username to use for SMTP credentials when sending messages.\n  Usually, this is your email address.\n- `subject`: The subject line of the email.\n- `data_path`: The path to the data file. This can be an absolute path or a\n  relative path starting from the directory where the configuration file is\n  stored.\n- `body_path`: The path to the body file. This can be an absolute path or a\n  relative path starting from the directory where the configuration file is\n  stored.\n- `server` (optional): The SMTP server to use. If none provided,\n  `smtp.gmail.com` is used.\n- `from` (optional): Who the email is from. This can be just an email address\n  (`name@example.com`) or can have a name (`Example Name \u003cname@example.com\u003e`).\n  Often, this is the same email address as `username`, but an alias may be used\n  as well. If no `from` address is specificed, the `username` is used.\n- `reply_to` (optional): The email address to use when a recipient replies to a\n  message. Must be an email address, with or without a name.\n- `to` (optional): The email address(es) for the \"To\" header of the email. Can\n  be a single address or an array of addresses. Each address may have a name.\n- `cc` (optional): The email address(es) for the \"Cc\" header of the email. Can\n  be a single address or an array of addresses. Each address may have a name.\n- `bcc` (optional): The email address(es) for the \"Bcc\" header of the email. Can\n  be a single address or an array of addresses. Each address may have a name.\n  or `text`. If none provided, `html` is used.\n- `related_content` (optional): A list of related content (e.g. inline images)\n  to include in the email.\n\nThe subject field (`subject`) and mailbox fields (`from`, `reply_to`, `to`,\n`cc`, `bcc`) of the configuration file file may include parameters of the form\n`{varname}`, to be substituted with values from the data file.\n\nExample configuration file:\n\n```json\n{\n  \"username\": \"name@example.com\",\n  \"from\": \"Example Name \u003cname@example.com\u003e\",\n  \"to\": \"{email}\",\n  \"subject\": \"Hello\",\n  \"data\": \"data.csv\",\n  \"body\": \"body.html\",\n  \"content_type\": \"html\",\n  \"server\": \"smtp.gmail.com\"\n}\n```\n\n### Body File\n\nThe body file is an HTML or text file specifying the body of the email. The body\nfile may include parameters of the form `{varname}`, to be substituted with\nvalues from the data file.\n\nWhen using `\"content_type\": \"html\"`, newlines in the body file are converted to\n`\u003cbr/\u003e`.\n\nExample body file:\n\n```\nHi {name},\n\nThis is an example email.\n```\n\n### Data File\n\nThe data file is a CSV file specifying how to parameterize each email.\n\n- A header row is required. The column names in the header row should correspond\n  to the parameters in the configuration file and in the body file.\n- There should be one additional row for each email to send, specifying what\n  values to use for each of the parameters.\n\nExample data file:\n\n```csv\nemail,name\nperson1@example.com,Person 1\nperson2@example.com,Person 2\n```\n\n### Related Content (optional)\n\nTo add an inline image, add the following to `related_content` in the\nconfiguration file, giving each a `content_id` of your choice.\n\n```json\n\"related_content\": [\n  {\n    \"content_id\": \"chosen_image_id\",\n    \"mime_type\": \"image/png\",\n    \"path\": \"path_to_image.png\",\n  }\n]\n```\n\nAdd the image into the HTML body of your email with:\n\n```html\n\u003cimg src=cid:chosen_image_id /\u003e\n```\n\n## Notes\n\n- For Google email addresses with 2-factor authentication, you'll need to create\nand use an [App\nPassword](https://security.google.com/settings/security/apppasswords) to use\nDispatch.\n- This tool used to be a Python script. If you're still looking for that version\nof the tool, you can find it tagged as\n[v0.1.0](https://github.com/brianyu28/dispatch/tree/v0.1.0).\n\n## Authors\n\n- [Brian Yu](https://github.com/brianyu28)\n\n## License\n\n- [GNU GPLv3](https://www.gnu.org/licenses/gpl-3.0.en.html)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrianyu28%2Fdispatch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrianyu28%2Fdispatch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrianyu28%2Fdispatch/lists"}