Skip to Content
avatar image
Former Member

How to charge a E-mail template in SAP Cloud SDK

I'm trying to upload a template that is in the C4C system in code.

I try to hard code the html and it works, and I can send the e-mail, but I want to upload a e-mail template to try not to modify the code everytime in the sdk environment when it is in production.

This is my code

//Create att folder
instEmailAttFld = instEmail.AttachmentFolder.Create();
//Add attachment (html body)
docName = "mail_prueba.html";
doctype.content = "1405";
//binaryObject.mimeCode = "text/html";
//binaryObject.content = Binary.ParseFromString( resultData.GetFirst().EmailTemplate );
binaryObject.content = Binary.ParseFromString("<html><head></head><body><div>" + body +"</div></body></html>");
instEmailAttFld.CreateFile(doctype, docName, docAltName, docDesc, binaryObject);
// send email

I want to modify this comment part:

//binaryObject.content = Binary.ParseFromString( resultData.GetFirst().EmailTemplate );

To obtain an EmailTemplate that it's in the applicattion.

Best regards,


Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers