In this post I have explained how to send Attachments along with notification's body in OIC Notification action.
Knowledge :👀
The total size limit on a notification email is 1 MB for Oracle Integration and 2 MB for Oracle Integration Generation 2.Steps overview to send attachment in OIC notification action :
- Open the Notification action and click on Plus icon "+" to add attachments.
- Select the Attachments ( 'Reference' )to add.You can edit or delete the attachment once added. Click save and close.That's it. Your configuration for sending attachment in email notification completed.
[You can take reference from below image:- Fig -1, Fig -2, Fig-3]
Info 👉 File Reference are of different types.For example, in the below image the integration includes three file reference attachments (highlighted in yellow) that are available for selection. You can select one or all as attachments.
- An attachment from a REST Adapter connection
- A file reference from a stage file write operation ⃕this case scenario I have covered in below hands-on practice.
- A file reference from an FTP Adapter download operation
#Hand-On Practice :
Use Case : Lets develop one simple APP DRIVEN ORCHESTRATION integration which can take some JSON inputs and that inputs will get send as an attachment in email notification in XML format.
Top view of integration which we are going to develop :
Lets see the steps in detail :
Step 1 : Crate one APP DRIVEN ORCHESTRATION by giving Integration a meaningful name.
Select any REST Trigger connection and configure the adapter as shown below -
- Configure the Request Sample JSON Payload window by entering below JSON and then click Ok.Click Next
{
"Employee" : {
"EmployeeDetail" : [ {
"Name" : "Amit",
"Id" : "01"
}, {
"Name" : "Rohit",
"Id" : "02"
} ]
}
}
- Configure the Response Sample JSON Payload window by entering below JSON and then click Ok.Click Next
{
"Message" : "Success"
}
STEP 2 : Now add Stage File Action and configure the adapter as shown below
- Enter a meaningful name , click Next
- In this window select XML Schema (XSD) Document.Click Next
- Stage File Action configuration completed. Click Done.
- Open the mapper to map the value
- Enter the basic details -- *FROM, *TO EMAIL ids, *Subject , *Body and then click "+" icon of attachments
Knowledge :👀
You can configure the approval email address to use in the FROM field on the notifications page that is accessible from Settings → Notifications.[as shown in below image]
STEP 5 : Enable Tracking for the integration
- Click Save and Close the integration . Integration is ready to TEST.
UNIT TESTING : -
- Activate the Integration
- You can see "Success" response in downward response window.
- Now check your email. You have received one email notification with payload as shown below :
- Email Notification along with attachment
Thanks for the blog .It was working fine. Getting mail with attachment.
ReplyDeletethank for the blog. it is very useful information to learn OIC
ReplyDeleteThank You Sreenivas :)
DeleteThanks for the blog, it is helping me in learning OIC
ReplyDeleteWelcome Harsha :)
DeleteExcellent blog, Keep posting bro, Thanks a lot. God Bless You Dear
ReplyDeleteThanks :)
DeleteGood stuff, Kabir.
ReplyDeleteDo you know on how to add attachemnts conditionally? E.g. I've created seperate generic integration for Error handling and passing fileReference to it and map it for attachment purpose in notification. But If it is empty ( so I do not want to attach anything ) it wouldn't send an email.
Read File --- >IF Data Available --> Trigger Email Notification
Delete|
ELSE-->Do not Trigger Notification
is there any way to ad "CC" in the notification
ReplyDeletei don't think CC option is available in email notification, we can configure FROM & TO only
DeleteHow can I do multiple attachments in notification?
ReplyDeletejust click '+' icon and add the other references ( STEP 3 )
DeleteI meant, how to multiple files dynamically? Lets say SFTP has n number of files, I need to send all files as an attachments in notification.
ReplyDeleteJust click on '+' icon present in Attachment Box and add all the 'FileReference' which you want to send attachment in notification
DeleteWhat if the file reference are generated dynamically
DeleteIt is possbile to set currentDate in attachment file name ?
ReplyDeleteyes u can. While assigning file name in the expression builder box, use CONCAT function
DeleteI have a requirement of sending an attachment of an ATP 's output table . Could you pls tell me the steps or a blog like this
ReplyDeletePlease connect me through email "thekabiryadav@outlook.com". Thanks !
ReplyDelete