cancel
Showing results for 
Search instead for 
Did you mean: 

Send an email with an HTML button in the mail body with SAP Intelligent RPA

xbealan
Explorer
0 Kudos
1,193

Hi everyone,

By using SAP Intelligent RPA features, I would like to send an email that includes an HTML button in the email body. With custom code or SAP Intelligent RPA outlook activity, is there a possibility to do that?

Thank you.

Best Regards,

Bengü ALAN

View Entire Topic
former_member717738
Participant

Hey Bengu Alan,

Here is the code that might help you to create a button in mail
ctx.outlook.init();
ctx.outlook.mail.create( { 
  To:'recipientMail@gmail.com', Subject:'Test email with button' 
}); 
var body_text = '<!DOCTYPE html>'; 
body_text += '<html>'; 
body_text += ' <head>'; 
body_text += '<title>HTML button Tag</title>'; 
body_text += '</head>'; 
body_text += '<body>'; 
body_text += '<button>Hello world</button>'; 
body_text += '</body>'; 
body_text += '</html>'; 
try { 
  ctx.outlook.mail.setBodyHtml(0, body_text); 
  var res = ctx.outlook.mail.send(0);
} catch (err) { 
  ctx.log("error : " + err);
} 
ctx.outlook.end();


xbealan
Explorer

Hi Mohammad Thousif,

It looks perfect. Thank you so much again!!!

Best Regards,

Bengu