In this post I will show one way to send Email notification with attachments.
This example will explain how to assign a string message that will appear on the mail as a HTML attachment.
In my next post I will explain how to read a file from your OS and send it as an attachment.
Start with creating a new bpel process. Create a new string variable and assign to it the required message that will appear later on in the HTML
(notice that you don’t need to add header/body tags):
Drag the Email activity. Enter the required fields, and in the body assign the string variable from previous step.
Mark the “Multipart message” checkbox (don’t enter nothing in the text area box) and press ok:
Double click on the new added Email activity and change the amount of attachments from 2 into 1:
Deploy and run the process.
You will get an email, with 1 attachment:
Another thing you might need, or want, is to change the attachment file name. You can see that the default name is “NotificationAttachment1.html”.
In order to change it, go to the source of the Email activity: Right click on the Email activity->View->Go to Source
Scroll down until you will get to this copy part:
Change the name “NotificationAttachment1” as you wish, for example – “HtmlFromBpel”:
Deploy and run. You will now see the new name:
Good Luck
Leave a Reply