-
1. Re: Problem in formatting mail text using jbpm mail tag
kukeltje Jun 4, 2007 4:27 AM (in response to naseem.k)The mail clients need to receive a specific content-type in the mail headers to be able to display html. jBPM does not support this. If you either adapt the source yourself or file a Jira issue (and make a nice patch with testcases, attach it to the Jira issue and it will be in the next minor release)
-
2. Re: Problem in formatting mail text using jbpm mail tag
naseem.k Jun 4, 2007 5:27 AM (in response to naseem.k)Thanks Ronald,
I think in that case to allow processing of html contents, content type should be set to 'text/html' using MimeMultipart. -
3. Re: Problem in formatting mail text using jbpm mail tag
kukeltje Jun 4, 2007 5:33 AM (in response to naseem.k)correct
-
4. Re: Problem in formatting mail text using jbpm mail tag
naseem.k Jun 4, 2007 5:57 AM (in response to naseem.k)
One more thing, I want to ask. I found no cc attribute in the mail tag. Now lets
say if I want to mark a person as cc, what should I do? -
5. Re: Problem in formatting mail text using jbpm mail tag
kukeltje Jun 4, 2007 1:23 PM (in response to naseem.k)new (not subject related questions) should go in a new post
-
6. Re: Problem in formatting mail text using jbpm mail tag
naseem.k Jun 6, 2007 6:02 AM (in response to naseem.k)Hi all,
I managed to get html contents in the mail by doing some trick. It looks like the problem is with the parser thats why to escape html < tags, forums also use square brakets instead of html tags.<mail name="M_MailAction" actors="user(nakhan81@yahoo.co.in)" to="#{Approve}" template="jbpm.mail.templates.xml" subject="Approval Mail to Admin"> <text>[table border='1' cellpadding='10'][tr][td]Note When you want to use the less-than symbol in an element's attribute, remember to use the entity reference '<'. The actual character in the attribute value (or in any attribute value) makes the stylesheet an ill-formed XML document, so the XML parser will choke on it and not pass it along to the XSLT processor.[/td][/tr][/table]</text> </mail>
In Mail.java class, following code replaces all square brackets to html tags.if(text!=null){ text = text.replaceAll("\\[", "<"); text = text.replaceAll("\\]", ">"); }
Secondly, I commented the following line.if (text!=null) { message.setText(text); }
and added the following line in the Mail.java classMimeMultipart mp = new MimeMultipart(); MimeBodyPart mainMsgPart = new MimeBodyPart(); mainMsgPart.setContent(text, "text/html"); mp.addBodyPart(mainMsgPart); message.setContent(mp);
Please share your comments on this.
Warm Regards,
Naseem -
7. Re: Problem in formatting mail text using jbpm mail tag
srohanrao Dec 11, 2008 7:49 PM (in response to naseem.k)Thank You Naseem. Your tip has been real help, I am now able to send HTML emails.
-
8. Re: Problem in formatting mail text using jbpm mail tag
kukeltje Dec 11, 2008 8:00 PM (in response to naseem.k)Cool.... any of you care to make this configurable (default being text) and contribute this to jBPM???? I'm wondering why so many people care to put time and effort into something that they have to adapt again with the next release but do not want to put a one-time effort in it and contribute back
-
9. Re: Problem in formatting mail text using jbpm mail tag
srohanrao Dec 11, 2008 8:08 PM (in response to naseem.k)I dont mind doing it but whats the process for this? If its easier to just send the code over to you and you can put it in I am fine with that also. Please let me know.
-
10. Re: Problem in formatting mail text using jbpm mail tag
kukeltje Dec 11, 2008 8:54 PM (in response to naseem.k)Attach it to this issue:
https://jira.jboss.org/jira/browse/JBPM-978
But keep in mind.... the default behaviour should not change, so it has to be made configurable. And a unittest is needed ;-)
TIA