Arkane API / Generate Framework
This toolset allows you to generate EMAILs programatically by uploading a template (with register) and then make calls with substitution data to generate.
This can also build a PDF and attach that, as well as handling attachments.