Click button inside mail body or create button inside mail body

How can I create a button options inside mail body, when the mail is being sent out by BOT. Buttons like “Approve” or “Reject”.
Also how can I make the BOT to identify a button item inside mail body, like whatever the persons responds with, whether Approve or Reject.

HI @pritha.kundu,

You can use Html Email with Hyperlink for “Approve” and “Reject” options.

By reading the mail and extracting the mail body you can get the approve or reject text.

Can you attach a sample code for the same

@pritha.kundu,

While clicking on “Approve” or “Reject” what needs to be done?

It should trigger back or respond to the mail from BOT with Approval or Rejection.
The response mail can be like:

Hi,
Your request is approved by XYZ(the person to respond) for the below mentioned responsibility:
ABCDE
QWERT

@pritha.kundu,

You can form a html email body with this as a hyperlink in that,

<html> <body> <a href="mailto:replytoAddress.p@xyz.com?subject=Request Approved &body=Hi, Your request is Approved by XYZ(the person to respond) for the below mentioned responsibility: ABCDE, QWERT">Approve</a> <a href="mailto:replytoAddress.p@xyz.com?subject=Request Rejected &body=Hi, Your request is rejected by XYZ(the person to respond) for the below mentioned responsibility: ABCDE, QWERT">Reject</a></body></html>

User needs to click on the Approve or Reject option and a plain mail will be opened in Outlook, so they need to click on Send button to send the mail with the auto generated text.

How do I use this html tag. It is giving me error when I use it in mail body. Can please help me with the activity to be used. I am using “Send Outlook Mail Message” activity to write this html tag.

@pritha.kundu,

Check this xaml and let me know in case any issues.
SendOutLookMail.xaml (5.1
KB)

Thanks. This solution is very helpful

Hey Sarathi,

Do we need any kind of configuration made in outlook for new mail to get popped up immediately? Because when I click approve, its asking for some account settings…Can you advise me on that?

@Anitha_krishnan,

While clicking on the approve button it will open a new outlook mail message with a to address mentioned and with this mail message “Hi, Your request is Approved by XYZ(the person to respond) for the below mentioned responsibility: ABCDE, QWERT”.

Do you have outlook installed where you are trying this workflow, check in a machine where outlook installed.

Hey Sarathi,

Thanks for your reply:) Yes I do have Outlook installed. But its asking for adding account when approve/reject is clicked, whereas if i open my mail box in web and click approve/reject, it working as expected(creating new mail to be sent). I don’t understand the issue with outlook installed…do we have to make any settings?

@Anitha_krishnan,

Do you have any mail account configured with the Outlook, if not then configure an account and try again

@sarathi125 I have a mail account already configured…but it still asks for an account to be set up…So I suspect that there is something to do with outlook desktop app and outlook web client

@Anitha_krishnan,

Which Outlook account you are using to send mails…

@sarathi125 do you mean to say that account from which mail is sent to my inbox should be configured to outlook?

So just for someone referring this thread…You just have to make Outlook as your default mail app in your system settings. It works!

Hi All,

I have a similar scenario.

Need to create a bot to read all the mail from outlook and open a particular mail which is for approval(mail triggered from MS Flow for approval) and click on the Approve button on the mail then provide some comments in the section and click Submit button.

Any suggestion would be appreciated.

Thanks in advance.

See this link

1 Like