Please, how do I create a downloadable pdf file from information filled by a user on my webpage, also the pdf file will be saved to a database on my site?
Thanks JD it works, but how can I send that file as an email to the user’s address automatically?
You’ll have to use Wix Triggered email or a third party email services’ API with a link to this file URL .
Thanks for the answer, I am not sure I captured the code process well, how do I get the Email ID and test this email since it is not on any wix plan?
Email from wix triggered email
Website code
export async function pdfButton_click ( event ) {
const pdfUrl = await getPdfUrl ({ name , address , number , startdate , subreference , plan , years , amount , validity , reference })
wixLocation . to ( pdfUrl );
wixCRM . createContact ({
“firstName” : $w ( ‘#text1860’ ). text , //first name of exixting user from login contact list to help wix recognise the user
“emails” : [ $w ( ‘#text1861’ ). text ], //email of this existing user from login contact list to help wix recognise the user
})
. then (( contactId ) => {
wixCRM . emailContact ( “EMAIL ID” , contactId , {
“variables” : {
“contact.Name.First” : $w ( ‘#text1858’ ). text , // Name from a different database not contact list
“invoice-number” : itemrr . reference ,
“preview-link” : pdfUrl //the pdf link
}
})
. then (() => {
})
. catch (( err ) => {
});
});
}
Hello everyone
The APIs named in the old posts are now all paid (no free account available).
I am testing the FREE API from pdflayer.com directly from the web option found on the Dashboard page.
The API with my key works perfectly if I point to wikipedia, google or any other website.
But it fails if I point to MY websites, hosted on Wix, with 404 error.
Will it be latency or some blockage from WIX?
Has anyone successfully tested the pdflayer API with wix sites?
Regards
Juan Pablo