4 ms·
I have a PDF problem that I thought was simple but has proven difficult to solve and there is no paid solution I’ve found… I want to forward an email to an inb
by RyanShook 3y ago
I have a PDF problem that I thought was simple but has proven difficult to solve and there is no paid solution I’ve found…
I want to forward an email to an inbox, have the email body converted into a PDF, and then email that attachment to someone all automatically. I’ve tried Make, Zapier, pdf.co, pdftool, and a few other tools but have had no success. Has anyone solved this problem reliably?
- toomuchtodo 3y agohttps://news.ycombinator.com/item?id=38545255 https://news.ycombinator.com/item?id=38545255 https://www.tapdone.com/ https://www.tapdone.com/ perhaps? Or something similar?
- RyanShook 3y agoThanks for sharing!
- victorbojica 3y agoIf you are able to code or can ask someone, then you should be able to do it with some email api service (Nylas, AWS SES, etc) or headless client that gets the body of the email and convert it to pdf using wkhtmltopdf and then send it as attachment using the same service as before. Using low/no code tools might be very hard/unlikely
- RyanShook 3y agoThanks, yes I think this is the right direction. Surprised it doesn’t exist as SAAS, I guess demand isn’t there.
- geraldwhen 3y agoIf you want the pdf to look anything like the email, you will need to render it in a browser and capture a pdf. It’s not particularly hard if you know what you’re doing.
- vinibrito 3y agoAny libs to help with that? Thanks.
- la_fayette 3y agoA headlees browser like e.g. puppeteer would do the job. I use it a lot for exatly that purpous...
- cyanydeez 3y agoI'm pretty sure you can do this with a Office365 & their automation stack Power Automate. Obviously it's only an option if your org has already sunk deep into Microsoft-of-things (MoT) universe.
- rqtwteye 3y agoI did something like this 10 years ago as an internal tool for a company. BAck then I did it with Outlook VBA.
- karl_gluck 3y agoGoogle Apps Script can do all of this. Take the email body and put it into a Google doc, then export the doc as a pdf to drive and attach it from there to send.
- fgonzag 3y agoIt seems quite doable but you'd need scripting skills to set it all up. Read the incoming queue, pass it to wkhtmltopdf then pipe the result to the mail command. For windows I believe I once used a java smtp server (apache james) that allowed you to set custom code as an incoming email handler. After that the conversion and email sending is trivial.
- brailsafe 3y agoProbably depends on the purpose of the pdf and why it needs to be an attachment, but I'd just skip all the steps and print the email since that's more or less what pdf is for. Print it and re-attach or just print at the destination.
- RyanShook 3y agoThis is what I currently do. I was just hoping to automate the process.
- cookie_monsta 3y agoIf you have access to O365 (or whatever it is called this week) this would be easy to do using powerautomate
- JumpCrisscross 3y agoI think Mail.app in macOS can do that with Automator. At the very least, the PDF emails coming from an email address and forward as attachment bits.
- mlfreeman 3y agoAnecdotal bug warning: Mail.app can "Export as PDF" from the File menu, but I noticed on 13.6 that it exports blank pages if the email is plain text only. I had to choose to print the emails and then save as PDF from the print dialog.
- hkhanna 3y agoI needed this for expensing receipts that come via email. I created an API for it where you POST the email to an endpoint and get back a PDF. Email me and I’ll give you access for free.
- reachableceo 3y agoIf you need to send an email anyway , why not print to pdf and email the pdf?
- davchana 3y agoI use Google apps script for it. A filter labels a specific email. A timed trigger runs a script. Script fetches all emails with that filter. Script runs in loop. Convers each message into a blob, blob gets converted to pdf. Pdf gets saved in google drive. Email gets label removed. My code was based on this https://www.labnol.org/code/19117-save-gmail-as-pdf https://www.labnol.org/code/19117-save-gmail-as-pdf