{"id":13895683,"url":"https://github.com/martineausimon/nvim-mail-merge","last_synced_at":"2025-08-30T06:43:49.154Z","repository":{"id":121158370,"uuid":"580532544","full_name":"martineausimon/nvim-mail-merge","owner":"martineausimon","description":"NeoVim mail merge plugin","archived":false,"fork":false,"pushed_at":"2025-05-07T19:22:44.000Z","size":53,"stargazers_count":13,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-07T20:27:34.625Z","etag":null,"topics":["csv","email","email-sender","mail","mail-merge","mailx","markdown","markdown-to-html","neomutt","neovim","publipostage"],"latest_commit_sha":null,"homepage":"","language":"Lua","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/martineausimon.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":"2022-12-20T19:54:14.000Z","updated_at":"2025-05-07T19:22:47.000Z","dependencies_parsed_at":"2024-11-25T01:30:32.162Z","dependency_job_id":"26bb9bb7-4c06-4838-9cb3-c402576d5f32","html_url":"https://github.com/martineausimon/nvim-mail-merge","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/martineausimon/nvim-mail-merge","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martineausimon%2Fnvim-mail-merge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martineausimon%2Fnvim-mail-merge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martineausimon%2Fnvim-mail-merge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martineausimon%2Fnvim-mail-merge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/martineausimon","download_url":"https://codeload.github.com/martineausimon/nvim-mail-merge/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martineausimon%2Fnvim-mail-merge/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272815816,"owners_count":24997661,"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","status":"online","status_checked_at":"2025-08-30T02:00:09.474Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["csv","email","email-sender","mail","mail-merge","mailx","markdown","markdown-to-html","neomutt","neovim","publipostage"],"created_at":"2024-08-06T18:02:23.317Z","updated_at":"2025-08-30T06:43:49.118Z","avatar_url":"https://github.com/martineausimon.png","language":"Lua","funding_links":[],"categories":["Lua"],"sub_categories":[],"readme":"# nvim-mail-merge\n\n**nvim-mail-merge** is a small mail merge plugin for [Neovim](https://github.com/neovim/neovim). It is primarily designed to work with [NeoMutt](https://github.com/neomutt) by default but also offers support for [mailx](https://linux.die.net/man/1/mailx). This plugin can send emails in either HTML format (`neomutt` only) or plain text.\n\n## FEATURES\n\n* **Create an individual and personalized message for each recipient of a .csv file**:  \nPrepare a `.csv` file including the `MAIL` field along with variables of your choice. `nvim-mail-merge` automatically fills in the information based on your values for personalized emails.\n* **Converts and sends an email written in Markdown to HTML format**:  \nWrite your email using the standard Markdown syntax. `nvim-mail-merge` converts it to HTML format for optimal formatting of your message (`neomutt` only).\n* **Sends plain text format emails** using either `neomutt` or `mailx`.\n* **Preview** the fully merged email before sending to ensure everything looks as expected.\n* **Save the history of sent emails** (date, subject, email)\n* **Monitor the progress of deliveries and view encountered errors** in the quickfix window.\n\n## REQUIREMENTS\n\nThis plugin requires :\n\n* [pandoc](https://github.com/jgm/pandoc) for HTML format emails\n* [NeoMutt](https://github.com/neomutt) configured correctly (see [.neomuttrc minimal example](https://github.com/martineausimon/nvim-mail-merge#neomuttrc-minimal-example))\n* For plain text format emails, you also have the option to use [mailx](https://linux.die.net/man/1/mailx), which might be faster\n\n## INSTALLATION WITH CONFIG\n\n### [lazy.nvim](https://github.com/folke/lazy.nvim)\n\n```lua \n{ \n  'martineausimon/nvim-mail-merge',\n  ft = { 'markdown' }, --optional\n  config = function()\n    require('nvmm').setup({\n      mappings = {\n        attachment = \"\u003cleader\u003ea\",\n        config = \"\u003cleader\u003ec\",\n        preview = \"\u003cleader\u003ep\",\n        send_text = \"\u003cleader\u003est\",\n        send_html = \"\u003cleader\u003esh\",\n      },\n      options = {\n        mail_client = {\n          text = \"neomutt\", -- or \"mailx\"\n          html = \"neomutt\"\n        },\n        auto_break_md = true, -- line breaks without two spaces for markdown\n        neomutt_config = \"$HOME/.neomuttrc\",\n        mailx_account = nil, -- if you use different accounts in .mailrc\n        save_log = true,\n        log_file = \"./nvmm.log\",\n        date_format = \"%Y-%m-%d\",\n        pandoc_metadatas = { -- syntax with [['metadata']] is important\n          [['title= ']],\n          [['margin-top=0']],\n          [['margin-left=0']],\n          [['margin-right=0']],\n          [['margin-bottom=0']],\n          [['mainfont: sans-serif']]\n        }\n      }\n    })\n  end\n}\n```\n\nTo monitor the progress of deliveries and view encountered errors, you can manually open quickfix with `:copen` (see [:h quickfix](https://vimhelp.org/quickfix.txt.html#quickfix)), or add this autocommand to your `init.lua` :\n\n```lua\nvim.api.nvim_create_autocmd('QuickFixCmdPost', { \n  command = \"cwindow\",\n  pattern = \"*\"\n})\n```\n\n## USAGE\n\n### DIRECT SEND\n\nThis plugin can directly send the buffer to specified recipient(s) (comma separated emails if several) with these commands :\n\n`:NVMMSendText charlie.haden@aol.com,paul.motian@yahoo.fr` (send the buffer in plain text format)  \n\n`:NVMMSendHtml charlie.haden@aol.com,paul.motian@yahoo.fr` (convert buffer from markdown to html and send)\n\n### MAIL MERGE\n\n#### 1) Create a .csv file containing the data of each contact\n\n⚠ The first line of this file must contain the headers, and one of the headers must be exactly `MAIL` (containing the email address)\n\nexample : `/home/user/list.csv`\n\n```csv\nCIV,LASTNAME,FIRSTNAME,MAIL\nM.,Tyner,Mc Coy,mccoy.tyner@gmail.com\nMrs.,Garrison,Jimmy,jimmy.garrison@caramail.com\nM.,Jones,Elvin,elvin.jones@yahoo.com\n```\n#### 2) Write a template mail in markdown in NeoVim\n\nVariables must be preceded by the symbol `$`\n\nexample : `nvim ~/template.md`\n\n```markdown\nHello $CIV $LASTNAME,\n\nYour message\n\nBest regards,\n\nYour name\n```\n\n#### 3) Configure the mail merge\n\nIn NeoVim, run the command `:NVMMConfig` (default mapping `\u003cleader\u003ec`) and enter the exact path of the csv file, then the subject of the mail. The subject can contain variables, always preceded by the symbol `$`.\n\n#### 4) Add attachment (optional)\n\nRun `:NVMMAttachment` (default mapping `\u003cleader\u003ea`) to add attachment to your mail. It can be a complete path (e.g. `/home/user/file.pdf`) or a variable, completed from your csv file content (e.g. : `$ATT`).\n\n#### 5) Preview the sending\n\nThe `:NVMMPreview` function (default mapping `\u003cleader\u003ep`) allows you to preview the sending with the data of the first recipient of the csv file.\n\n#### 6) Send\n\nRun one of the following commands :\n\n`:NVMMSendText` (default `\u003cleader\u003est`)  \n`:NVMMSentHtml` (default `\u003cleader\u003esh`)\n\n#### Log file\n\nBy default, NVMM writes a log file `./nvmm.log` with the date, format (text or html), subject and recipient's email when sending all.\n\n## TIPS AND TRICKS\n\n### neomuttrc minimal example\n\nThis config works with a Gmail account, and [pass](https://wiki.archlinux.org/title/Pass) to keep your password encrypted. With Gmail you'll also need an [app password](https://support.google.com/accounts/answer/185833?hl=en).\n\nAdd this lines to your NeoMutt config file (default `$HOME/.neomuttrc`) :\n\n```bash\nset my_pass = `pass eric.dolphy@gmail.com`\nset from = \"eric.dolphy@gmail.com\"\nset realname = \"Eric Dolphy\"\nset imap_user = \"eric.dolphy@gmail.com\"\nset imap_pass = $my_pass\nset smtp_url = \"smtps://eric.dolphy@smtp.gmail.com\"\nset smtp_pass = $my_pass\nset copy = no\n```\n\n### mailx minimal config example\n\nThis config works with a Gmail account. With Gmail you'll also need an [app password](https://support.google.com/accounts/answer/185833?hl=en).\n\nAdd this lines to your mailx config file (`$HOME/.mailrc`) :\n\n* one account :\n\n```bash\nset v15-compat\nset from=\"jim.hall@gmail.com(Jim Hall)\"\nset smtp-use-starttls\nset smtp-auth=login\nset mta=smtps://jim.hall:app_password@smtp.gmail.com:465\n```\n\n* multiple accounts :  \n\nDon't forget to set `mailx_account` in `setup()` function\n\n```bash\naccount main {\n  set v15-compat\n  set from=\"jim.hall@gmail.com(Jim Hall)\"\n  set smtp-use-starttls\n  set smtp-auth=login\n  set mta=smtps://jim.hall:app_password@smtp.gmail.com:465\n}\n\naccount anotheraccount {\n  set v15-compat\n  set from=\"ron.carter@gmail.com(Ron Carter)\"\n  set smtp-use-starttls\n  set smtp-auth=login\n  set mta=smtps://ron.carter:app_password@smtp.gmail.com:465\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmartineausimon%2Fnvim-mail-merge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmartineausimon%2Fnvim-mail-merge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmartineausimon%2Fnvim-mail-merge/lists"}