Oh hey, sorry, hadn't checked this thread in a while. It's Node, using ImageMagick for the page images and pdftk to assemble the final PDF. All the interesting bits (in my view, because email is mysterious to me) are handled by Mailgun
http://www.mailgun.com/ which I've been very happy with so far.