Posted: 27 Feb 2018 2:14 EST Last activity: 16 Oct 2018 0:43 EDT
Sending an Email with Attachment (PDF generated during run time
Hi Team, We have a grid which contains some Information and on top of the grid we have Export to PDF and Send Email Buttons. Upon clicking Send Email button, Email address of the recipient is collected and a PDF is generated with the contents of the Grid, attached to the EMAIL and sent to the users. I've used pxCreatePDF activity to generate PDF and attach it to my custom Attachment category and used SendEmail smart shape to send email to Recipient Email address including the attachments from the attachment category. I am facing the following issues with this approach: 1) PDF that gets generated via pxCreatePDF is empty (table header is coming). For Export To PDF button I have used the same activity (customized - Instead of attach, used View) and I was able to generate PDF with all information by providing the same section. Not Sure why Empty Table is getting generated. 2) In pxCreatePDF activity, I've created my custom attachment category and in SendEmail shape I've mentioned the same. When executed, for the first time no PDF is being sent, next time empty PDF is successfully received as an attachment by recipient. On the third time, 2 PDFs with same name are sent. Next time 3 PDFs with same name are sent. Is there a way to Overwrite the attachments in the category with same name? Thanks, Vamsi
You mentioned using the smart email shape but not the smart pdf shape. If you use the smart pdf shape instead of calling the pxCreatePDF activity directly, does it give you better results?
Another idea is, if you're wanting to re-use the same name, but it's ending up with duplicate files and you wished it overwrote instead, can you work around it by deleting the first file before you re-use the same name?
Yes, we have even tried using SmartPDF shape in the flow instead of pxCreatePDF activity. But still, behavior is the same. First Time no attachment is send. Second Time one Empty PDF is sent (contains table header alone) and for the third time 2 empty PDFs are being sent.
Nothing worked for me to generate PDF and SendEMail simultaneously. So, I'm creating the PDF (using CreatePDF smart shape) immediately when the required data is available and am using SendEmailWithAttachments activity to email the PDF which is already attached to my work object.
I tried your option of calling sendEmailWithAttachments after creatPDF smart shape. But again email is sending without attachment. If i call sendEmailWithAttachments activity or direct sendemail smart shape after loading an assignment ( ie, CreatePDF - Assignment - SendEmail ), it is attaching. Not sure what is the issue is.