X

The Integration blog covers the latest in product updates, best practices, customer stories, and more.

How to send email with attachments in OIC?

Niket Narang
Principal Member of Technical Staff

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.

Prerequisite

  • Enable feature flag: 
    oic.ics.console.notification-attachment

Click here to learn on how to enable feature flag. The minimum Oracle Integration version required for the feature is 191020.0200.32001.

Note - The notification attachment functionality is currently supported only in OIC Gen 1.

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.

  • Hello World with Attachment integration created is attached for reference and can be used after configuring the FTP connection.
  • The size limit on the email is 1 MB for OIC Gen 1 and 2 MB for OIC Gen 2. Both email body and attachment are considered in calculating the total size.

Hope you enjoyed reading the blog and this new feature helps in solving your business use-cases!

Join the discussion

Comments ( 5 )
  • Monish Munot Thursday, November 7, 2019
    Most awaited feature!
  • S Balaji Thursday, January 2, 2020
    Can we automate this.. like for a given document name this should attach the document from a location and send mail.
  • Traian Thursday, January 9, 2020
    Hi

    Do you know the maximum size of attachment which can be sent via this feature ?

    thank you
  • Ana Tuesday, January 14, 2020
    For most of the customers it is 1MB. The exact limit for the instance can be checked by CNS team as there have been cases where they have increased the limit for a customer.
    Also, this limit is including both body and attachment content
  • mack Monday, March 2, 2020
    Thanks . This helps a lot.
    I would like to know below things:

    1. What is maximum size of attachment file can be transferred through OIC?
    2. If I want to do it then Please let me know the process to do the same using OIC.
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.