简体   繁体   中英

Email xepOnline generated file

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM