Quantcast
Channel: SCN : All Content - Process Integration (PI) & SOA Middleware
Viewing all articles
Browse latest Browse all 7030

Setting dynamic attachment name in mail adapter

$
0
0

Hi experts,

I have a mail adapter that send e-mails from ECC to several address.

I have configured dynamically the FROM and TO field using the code showed below in message mapping:

 

public String SetMailParameters(String Mail_address_to, Container container){

   //write your code here

  String valueFrom = "my_address";

 

DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

 

DynamicConfigurationKey key1 = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/Mail",  "THeaderFROM");

DynamicConfigurationKey key2 = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/Mail",  "THeaderTO");

 

conf.put(key1, valueFrom);

conf.put(key2, Mail_address_to);

 

  return  "";

 

In communication channel I have checked ASMA and variable transport binding (using XHeaderName1 and 2), mail package is not checked.

 

It works fine!

 

My question is:

I need to dynamically configure also the Attachment name: is it possible?

I've tried adding the code below:

 

DynamicConfigurationKey key3 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");

conf.put(key3,Attachment_name);

 

and also

Transform.ContentDisposition      attachment;filename=<FileName>

in Message TransformBean in communication channel, but it doesn't work!!!

 

Any idea?

Thanks

Fabio Boni


Viewing all articles
Browse latest Browse all 7030

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>