I am currently using xepOnline to generate a pdf of my page.
This is working perfectly , but i now want a button next the download button which opens the mail program on your pc and attaches the generated pdf file.
My code so far: (not much)
function emailCurrentPage(){
window.location.href="mailto:?subject="+document.title+"&body="+escape(window.location.href);
}
<button onClick="javascript:emailCurrentPage()">Doormailen</button>
<button href="#" onclick="return xepOnline.Formatter.Format('content',{render:'download'},{pageWidth:'216mm', pageHeight:'279mm'}, {filename:'Test'});">Opslaan als PDF</button>
The syntax of mailto does not accept attachments. See the following as one description.
https://yoast.com/dev-blog/guide-mailto-links/
You would only be able to open the email itself with the TO, CC, BCC, Subject and Body filled out and the user would have to manually attach the PDF downloaded.
In @cloudformatter, the PDF is returned and is stored in the response. You could override the response handler to resend that PDF to a server-side application that sends the email for you.
As one of the authors of the xepOnline script and the server-side application that is handling the requests and formatting the PDFs, we already developed and have such functionality in the server itself. It is not available in the free-to-use version as we cannot support tens of thousands of emails sent daily by the users.