cancel
Showing results for 
Search instead for 
Did you mean: 

Attachment in Send Email Operator

0 Kudos

Hello Community,

I am trying to add an attachment to the email notification from the ML scenario pipeline. The below link shows some parameters as "email.attachments", but I am not sure how to configure that.

https://help.sap.com/doc/de49c012b53d476eae7af14497eac256/2.4.latest/en-US/8da19b12f4744ebca050b9588...

I have tried adding {"email.attachments":[<Path of DI DATA LAKE of File>]

But this fails to add the attachment.

Any help would be appreciated!

Thank you.

simon_kussmann
Participant

Hi Sumit,

I just tried something similiar. In my case I wanted to send a Pandas Dataframe as .csv file as attachment. You need to save the file locally e.g. in /tmp/ (inside the running container):

df.to_csv("/tmp/file.csv")

attributes = {
    "email.from": "from@mail.com",
    "email.to": ["to@mail.com"],
    "email.subject": "Test mail from SAP DI",
    "email.attachments": ["/tmp/file.csv"]
};

send_body = "This is the mail Text."

api.send("outMessage", api.Message(attributes=attributes, body=send_body))

I hope this helps.

Simon

amish1980_95
Participant
0 Kudos

Hello,

I followed as Simon suggested,however I am still getting "could not create attachment " error.

Please advise.

Thanks,

Indu.

Accepted Solutions (0)

Answers (0)