Skip to Content
author's profile photo
Former Member

Rest to PI to Mail Receiver

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

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Posted on Feb 25, 2017 at 06:13 AM


    1.Convert your json to xml in rest adapter.

    2.Then convert the base64 to pdf using java mapping refer this thread:

    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



    Add comment
    10|10000 characters needed 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