Skip to Content
0

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

Feb 10, 2017 at 10:13 PM

53

avatar image

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

instEmail.MessageToParty.Create(elEmailParty);
//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
instEmail.Send();

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,

Eric

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

0 Answers