cancel
Showing results for 
Search instead for 
Did you mean: 

How to add an attachments in the Email Task

shivakumar1
Champ in-the-making
Champ in-the-making
Hi All,

I have a requirement which requires an attachment in the email, is there any way to add attachment using email task.
Can anyone  suggest me, how to achieve this requirement.
9 REPLIES 9

sathish1
Champ in-the-making
Champ in-the-making
Hmm not sure if this would be possible. My understanding is framework uses field injection for populating mail task information. So it can allow Strings and other EL expressions. But would be curious.
Quick solution for mail attachment is, host a https link in the mail body and parameterize it so that only users with secured access and variables only access it., Cheers.

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi,

is there any way to add attachment using email task.
Activiti's email task does not support attachments.

You can extend email task implementation to support attachments. (I would say that in your case e-mail sending should be asynchronous - can be time consuming)

Regards
Martin

shivakumar1
Champ in-the-making
Champ in-the-making
Hi All,

I'm using activiti-explorer for designing bpm files.
As per @martin suggestion i have written my custom class which extends the MailActivityBehavior .
Configured service task and added extension elements by using class fields in the activit-explorer.
I'm able to send the email with attachment,but the body of the email is giving raw html code.

for an example i have configured the html element with
"<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">"
When i export the bpm file i'm getting replaced as the below code
"&amp ; lt;!DOCTYPE html PUBLIC &amp;quot;-//W3C//DTD XHTML 1.0 Strict//EN&amp;quot; &amp ; "
which is causing email to print the raw hmtl code.
For quick solution i  changed the bpm file and exported it with appropriate html code, i'm able  to get the proper mail content.

Can you please suggest me how to overcome this issue, i need to give the editable email contents from activiti-explorer for the client implementation teams.



shivakumar1
Champ in-the-making
Champ in-the-making
Can any one please suggest me how to overcome the raw html code in the email.

jbarrez
Star Contributor
Star Contributor
wrap it in CDATA … would be the normal XML approach … ?

shivakumar1
Champ in-the-making
Champ in-the-making
@jbarrez  can you please guide me how to use CDATA.

shivakumar1
Champ in-the-making
Champ in-the-making
can you give me example to use CDATA.

trademak
Star Contributor
Star Contributor
Please use google for this. It's basic XML knowledge.

Best regards,

ankith_k
Champ in-the-making
Champ in-the-making

shivakumar _‌ Can you please share your code as to how you implemented custom email activity for attachments?

Thanks in advance

Ankith Kumar K

Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.