Plain-text mail merge with images

Hi all,

I have a markdown file with references to images (both stored in a Git repo) that I’d like to convert into a bulk email mail merge, to send out an email newsletter that includes inline images. Seems ripe for automation! However, I don’t really know how…

Some details:

  • The only thing that would change in the email text is the person’s first name - nothing else.
  • I’d be happy to use macOS or iOS
  • I don’t want to use proprietary tools like the Microsoft Office suite.
  • AppleScript and shell script are fine, as long as people can give me the relevant code or at least point me in the right direction.
  • MailMate (the macOS email client that I use) has a command line interface, which is excellent. However, its support for resizing inline images is limited. Resizing the images myself resulted in pixelated images in MailMate.
  • I found some puzzle pieces at Automators 2: Workflow - Mail Merge and Automators 2: Use AppleScript to Insert Recipient's Name, but a bit more guidance would be helpful, particularly regarding the inclusion of images.


Do you want to attach the images or just have them served from the web when the user opens the email? The latter will probably be simpler.

Not attached - I want the user to see images interspersed with text.