Highlighted

Attach a pdf on fly in email after click on submit

Avatar

Avatar

Prince_Shivhare

Avatar

Prince_Shivhare

Prince_Shivhare

21-01-2018

Hi Guys,

I have one functionality where I have to click on submit button and generate email with attach a pdf.

- I am able to send the email.

- pdf contains dymanic content which is coming from API.

- this pdf is working fine. only need to attach it in email on fly or saving somewhere. and delete auto after sometime.

please help me in this.

Regards,
Prince Shivhare

Replies

Highlighted

Avatar

Avatar

edubey

Total Posts

1.5K

Likes

264

Correct Answer

392

Avatar

edubey

Total Posts

1.5K

Likes

264

Correct Answer

392
edubey

21-01-2018

Where are you keeping the pdf when once it has been populated with dynamic content?

Possible to share code snippet?

Highlighted

Avatar

Avatar

Prince_Shivhare

Avatar

Prince_Shivhare

Prince_Shivhare

22-01-2018

Hi Praveen,

we are able to generate the pdf. and able to attach it.

so its not necessary to do on fly. we can also save it for temp basis in crx and then delete.

for now we have kept one pdf in crx dam and attaching it. now our challenge is to save a pdf in dam dynamically. and delete after sometime.

and I have one more question here i.e if I will save it. will it create a rendition of it? because if pdf having 5 page. then it creates a 5 rendition. and we have to show original one.

Highlighted

Avatar

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Answer

2.3K

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Answer

2.3K
smacdonald2008

22-01-2018

Prince - why not create Java EMAIL API to send an email and then attach the PDF as an attachment.

JavaMail API - Sending Email With Attachment

Highlighted

Avatar

Avatar

Prince_Shivhare

Avatar

Prince_Shivhare

Prince_Shivhare

22-01-2018

Scott - code related to mail was already written by some other person. who is using MultiPart.

well I am able to send email and also in click on submit, I am able to save the attachment in dam folder.

and also able to send manually uploaded attachment with static path.

now only action required from my side is to attach the same pdf which will be downloaded in submit button. i.e dynamically getting the pdf. and then delete after sometime.

Highlighted

Avatar

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Answer

2.3K

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Answer

2.3K
smacdonald2008

22-01-2018

If that is an issue - look at writing the new service  that uses Java Email API and then have it attach the file.