Skip to Content
Author's profile photo Praveen Gandepalli

Send Email Confirmation After Successful Delivery of the File to Receiver


The common requirement is to send email confirmation after successful delivery of the file to the receiver, i see this question asked so many times in SCN example discussion; Content is not allowed in prolog

I want to show you step by step how to implement above requirement in this blog.


Create the data type like below, it can be any data type because the file is non XML.


Create a message type and refer the above data type and create the below service interfaces. One is sender side receive the file, one is to send the file to the receiver and other one for send the mail.


Since file is non XML so select the interface pattern to Stateless (XI30-Compatible) for SenderData_Out service interface then we no need to remove the software component in ICO.


Create below java mapping for dynamic email body when sending the mail.

import java.text.SimpleDateFormat;
import java.util.Date;
public class DynamicEmailBodyJavaMap extends AbstractTransformation {
  public void transform(TransformationInput transformationInput, TransformationOutput transformationOutput)
  throws StreamTransformationException {
  StringBuilder sb = new StringBuilder();
  try {
  DynamicConfiguration conf = transformationInput.getDynamicConfiguration();
  sb.append(conf.get(DynamicConfigurationKey.create("", "FileName")));
  sb.append(" file has been sent to POD on ");
  sb.append(new SimpleDateFormat("dd/MM/yyyy").format(new Date()));
  } catch (Exception e) {
  throw new StreamTransformationException(e.getMessage());

Create imported archive and import the java mapping jar.


Create a operation mapping between SenderData_Out and MailReceiverData_In



Create IFLOW with interface split, one is to send the file and one is to send the mail. Create 3 sender channels one is pick up the file, one is send the file to receiver and other one is send the mail. Select the operation mapping for mail interface.


Select the check box maintain order at runtime to maintain order for file interface and mail interface, the mail will send only the file delivered successfully.


Receiver mail channel configuration, don’t select the mail package as mentioned in this blog Stop using Mail Package! © – Simplify your mail receiver adapter scenarios and type from, to and subject fields.


Maintain below module configuration in the mail channel.



Place the file in source directory.


The file delivered successfully and the mail also sent successfully. The order also maintained at runtime according to our configuration.


The file placed in the target directory.


The email sent to the respective person.



Using interface split and maintain separate interface for send the mail and using maintain order at runtime option we can able to send the email after successfully delivered the file to the receiver, i hope this question will not repeat again in the forum 😉 .

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      Thanks! Praveen

      I was struggling for this requirement since 3 months. Finally I did it. 🙂



      Author's profile photo Vijay Kumar KVN
      Vijay Kumar KVN

      Hi Praveen, Thanks for sharing the document. Praveen. Is there a way that i can generate the Subject of the mail dynamically. if possible kindly share me.

      Author's profile photo Praveen Gandepalli
      Praveen Gandepalli
      Blog Post Author

      Hi Vijay,

      Yes in the java mapping if you set adapter specific message attribute THeaderSUBJECT then you will receive dynamic subject. Check scenario 3 in this blog Stop using Mail Package! © - Simplify your mail receiver adapter scenarios



      Author's profile photo Vijay Kumar KVN
      Vijay Kumar KVN

      Hi Praveen, Thanks , got it 🙂

      Author's profile photo Anoop Rai
      Anoop Rai

      Hi Praveen

      Nice document bro.


      Anoop Rai

      Author's profile photo Ninad Sane
      Ninad Sane

      Hi Praveen ,

      Can you guide us for getting email notification  if the scenario is such that file is not getting successfully delivered to Receiver because of issues in FTP connectivity , server down etc.


      Ninad Sane

      Author's profile photo Praveen Gandepalli
      Praveen Gandepalli
      Blog Post Author

      Hi Ninad,

      You can setup alerts for the interface, then any connectivity issues then email will be triggered.

      If you have more questions better to open separate discussion.