function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
anil kumatanil kumat 

How to build "Yes and No" Buttons in Email template?

How to build "Yes and No" Buttons in Email template?Here My requrement was iam sending email template through Url.It was working fine.But now i nedd to change in that one.That is i want to add "yes and  No " buttons in that email template.when the reciepient click on "yes" button then the Case should be automatically close & status feild should be updated? Can any one help me plz?
Iqrar AhmedIqrar Ahmed
Hi anil,
you can do this by creating email templates using viusalforce see example like you want

Senior Salesforce/.Net Developer
anil kumatanil kumat

Thanks for the reply.but here what iam searching for how to create buttons in email template.

When we have a suggested solution, the contact should be sent this solution. From the email he receives, he should be able to close the case. So in the email there should be a button which asks the user "did this resolve your case? - Yes, and no". If yes, this should close the case.(this is actuall requrement).
Iqrar AhmedIqrar Ahmed
Hi anil,

You can do this by only email service allow email reciver to reply on address which you will generate in email service handler and write email handler on this service that take case id from email and perform action on case according on the basis of email text.

For example 

The email is sent by salesforce to user is this 

"Caseid : 5000nx1" through this you can identify on which case operation will be perform.
create some logic that your email handler can decide what operation should be perform.

set replyto url to :email service url.

Best Regards
Senior/.Net Salesforce Developer

Hi , 

If you are sending email to salesforce user  - visualforce email templates works. The person can login and excute yes link.

If you are sending email to outside , email service is the only option. Check the below links.

William LópezWilliam López
Hi all,

As  Cloud Rocky said the email service its a good option.

You can also (if you have the right linceses) create a site and a small visual force page and a controller. So in the email you put 2 Immages as buttons. But this images are going to be just images with a link to the new controller, quick code of my idea:
<a href="">
<img src="YesImage.png">

Then you will have page call  "EmailCasePage" and in the controller just take the CaseId paramenter and the option parameters that were sent as URL get parameters. With those variable you will be able to get the case and update it properly.

Please let me know if this helps,


Neha SarinNeha Sarin

Di anyone get an anwer to this?
Neha SarinNeha Sarin

I have been given the same requirement. can anyone let me know if I create visualforce template then how to create YES and NO buttons on the template?

The functionality of the yes button is that it will close the current case.

if there is a piece of code can anyone share it please. It will be a great help.

Guy R TanguayGuy R Tanguay
It's been a while for this post, but I have to implement this functionality, did anyone implement this solution?  Can you share your steps?

Thank you in advance.

Did anyone completed this requirement ?
i recently got this requirement and any help is greatly appreciated.

Thanks in advance.