cancel
Showing results for 
Search instead for 
Did you mean: 

Rest to PI to Mail Receiver

Former Member
0 Kudos

Hi Guys,

Need your help on the below scenario.

Usecase: REST-->PI-->Mail

UI will pass on a feedback form with an attachment that may be either (.pdf, .txt, .jpg, xlsx format). The attachment content will be passed to PI in bytearray(base64 string).

And for attachment: file type, filename and base64 string will be provided by UI.

Rest of the fields like To, From, Subject and Content will be passed in a json format.

Now we need to send a mail with attachment after reading the byte array with the file format and file name provided.

Please provide your valuable suggestions to crack this out.

Best Regards,

Sachin Jangir

Accepted Solutions (0)

Answers (1)

Answers (1)

manoj_khavatkopp
Active Contributor

Sachin,

1.Convert your json to xml in rest adapter.

2.Then convert the base64 to pdf using java mapping refer this thread:https://archive.sap.com/discussions/thread/3603150

3.Addition to this set the converted pdf as attachment with outputattachment class and use dynamic config to set the to,from etc for mail adapter

https://blogs.sap.com/2016/03/10/stop-using-mail-package-simplify-your-mail-receiver-adapter-scenari...

Br,

Manoj

Former Member
0 Kudos

Thanks Manoj for your inputs.

Is there any other option of achieving this without Java Mapping?

Let me know if there is other way to achieve this using UDF in Graphical mapping and standard Modules.

Incase it is not doable with Graphical mapping, I'll go with the Java Mapping option.

Also I would like to know whether we can handle the attachment with different file extension in it like (jpg, png, xlsx, txt, pdf & etc).

Best Regards,

Sachin Jangir