Have you ever encountered a scenario where the requirement was to send attachments along with email notification in OIC and you could not? Well, now it is possible. The new feature makes it really easy to configure notification activity to add attachments along with the email.
Click here to learn on how to enable feature flag. The minimum Oracle Integration version required for the feature is 191020.0200.32001.
Step By Step Guide to Send Notification with Attachment
There are multiple ways in OIC to work with files. Some of the options are i) configure REST adapter to accept attachments as part of the request, ii) use Stage file activity to create a new file or iii) use FTP adapter to download the file to OIC from remote location for further processing. Any file reference(s) created by upstream operations can be used to configure attachments in the notification activity. Let us learn how we can configure notification action to send email with attachments in simple steps:
- For this blog, we will clone the sample integration ‘Hello World’ that is available with OIC.
- Navigate to the integration landing page, clone the 'Hello World' integration and name it 'Hello World with Attachment'
- Navigate to the canvas page for the newly created 'Hello World with Attachment' integration
- Edit the configuration for the REST trigger and change the method type to POST, media type to multipart/form-data and configure request payload parameters to accept attachments.
- We will add a FTP connection (DownloadToOIC in the image below) and select 'download' operation to download the file to OIC. Here, I have configured FTP connection to download a 'Sample-FTP.txt' file which is already created and present in the remote location.
- Now, let us add a Stage File action to create a new file. Here, I have configured stage file to write the request parameters - name, email and flow id separated by a comma and name it as 'StageWriteSample.txt'. Refer to the blog to learn more about how to use Stage activity.
- This will allow us to configure multiple files as attachments in the notification activity later. The updated flow now looks as shown below
- Edit the notification activity (named as sendEmail in the sample integration) and we should see a new section "attachments" next to the body section.
- Clicking on the add button (plus sign) in the attachments section will take us to a new page to choose the attachment.
- We have three file references (highlighted in yellow) available to choose from - attachment from REST connection, file reference from the stage file write operation and file reference from the FTP download operation.
- We can select file reference(s) each at a time to send the files as attachments. User can edit or delete the attachment once added.
- The notification activity after configuration should have 3 attachments.
- Save and activate the integration and now your integration is ready to send emails with attachments.
- Sample email is shown below when the above flow is triggered.
Hope you enjoyed reading the blog and this new feature helps in solving your business use-cases!