Unfortunately, this is not possible — you must first send the email and only then generate the PDF of the given document.
Sending Email with Attachment Saving
Can an email sent via API automatically save the attached PDF file?
Written by Petr Pech
Can an email sent via API automatically save the attached PDF file?
Unfortunately, this is not possible — you must first send the email and only then generate the PDF of the given document.