Skip to Content
0

Rest to PI to Mail Receiver

Feb 25, 2017 at 12:04 AM

159

avatar image
Former Member

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Manoj K Feb 25, 2017 at 06:13 AM
1

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-scenarios/

Br,

Manoj

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

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

0