cancel
Showing results for 
Search instead for 
Did you mean: 

email Notification option for File to SFTP scenario

Harish
Active Contributor
0 Kudos

Hi Experts,

We have a scenario where a CSV file is picked up and sent to target SFTP server (pass through). Now the customer is requested to generate the notification once the file is sent. We had thought for below options

1. Add one more receiver component and trigger the email channel - Issue (The data is sent as an email attachment which is not required)

2. call email channel from receiver SFTP channel modules (Module process bean etc.) - It is also passing the message data (file data) which is not required

3. Pick the file from source and move to some temp folder, then create another scenario to move the to complete folder and trigger the notification.

Can you please suggest which is the best way among this or any other option to send the notification.

Thanks

Accepted Solutions (0)

Answers (3)

Answers (3)

binod8
Active Participant

Hi Harish,

I understand that you want to send email only once the SFTP system receives the file.

I would suggest for below configuration.

1> Check "Maintain Order at Runtime", will make sure that email is only send once the SFTP channel is successful.

2> Email interface should be the second interface in the "Receiver Determination".

3> For email body or subject of the email, you may create small mapping in ESR with your desired email body and subject of the email (You may also include the name of the file for better understanding)

Hope this helps!!

Thanks& Regards,

Binod Kumar Mondal

Harish
Active Contributor
0 Kudos

Hi Binod,

Thanks for your answer. We tried this option but the csv is coming as an email attachment. We do not want CSV data to be sent with the email. Do you know any way to remove the attachment?

regards,

Harish

anupam_ghosh2
Active Contributor
0 Kudos

Hi Harish,

I would prefer multi-mapping with two receivers as overall this simplifies a complex scenario. This will be easy to understand in future and easier to troubleshoot. Receiver1 will be SFTP adapter . Receiver 2 will be mail adapter. The message to mail adapter will be of below format

Set the following mail adapter attributes from,to and subject using a java mapping. You do not need to provide any attachment or body of the email. The subject will contain the name of the file and target SFTP server is up and running. In the java mapping you need to verify if the SFTP server used for receiver1 is up and running. You can check this code reference.

This ensures not only file has been sent but also sftp server is up and running to the business.

This multi-mapping will be through java mapping. You can follow this blog for reference.

The java mapping will write the payload to receiver1 (SFTP) and set attributes (from,to and subject) for receiver2 (mail).

If you do not want java mapping then you need custom adapter module doing the same purpose but it will be a complex code to do as you need to call the mail commuication channel or write entire code of mailing in java.

Point 3 (mentioned by you) is not a good option because it does not guarantee SFTP server is up and running or not , secondly troubleshooting of two phase scenario will be difficult.

Regards

Anupam

Harish
Active Contributor
0 Kudos

Hi Anupam,

Thanks for your answer. I had put the custom code or java mapping as a backup option. The only concern with this is maintained and upgrade. Java mapping requires move expertise in maintains and there will be extra effort during upgrade activity.

Thanks,

Harish

former_member194786
Active Contributor
0 Kudos

Hi Harish,

With all the above options, I see the potential of sFTP site being down and a false positive email notification being sent.

2 options come to mind:

  1. Have multiple interfaces to same receiver and use the second interface to send the email notification out using email adapter. You can map only the required fields to pass to the email adapter.
  2. Or, you can try the archive option of the sFTP adapter, which will write the file in another location as well. Another iFlow can then read and delete that file and send the email notification out.

Best Regards,

Sanjeev

Harish
Active Contributor
0 Kudos

Hi Sanjeev,

Thanks for your answer. With multi mapping is this possible to remove the attachment file coming in receiver email?

The SFTP option is a bit tricky as the SFTP is external and we need to request to provide user with delete access.

Thanks,

Harish

former_member194786
Active Contributor
0 Kudos

Hi Harish,

On the contrary, sFTP will let you save the file on the local directory instead of the 3rd party directory. Here is a screenshot from one of my interfaces:

sftp.png

Regarding multimapping, never tried it and didn't even know to be frank that it will pass the file as attachment. Have you tried playing around with the payloadSwapBean at all?

Best Regards,

Sanjeev

Harish
Active Contributor
0 Kudos

Hi Sanjeev,

Thanks for your response. I tried playing around swap bean but unable to remove the attachment.

regarding SFTP local file directory, I do not have local SFTP server, so not sure how this option will work. How the adapter login to the location which we specify in this?

regards,

Harish

former_member194786
Active Contributor
0 Kudos

I meant it saves the file on local NFS share or SAP PO file system that you may be using for other interfaces already. You won't be able to archive on a different sFTP site.