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
sonam gupthasonam guptha 

if check box is set to true and clicks on a custom button we need to send some URLs

HI,

i have a apex class which will trigger some functionality and will sent some email on a single button click on contact table,so now i need to add a checkbox on the same contact table and if user checks the checkbox and clicks on the custom buttom, we need to add some URLs to it,is it possible?and that URLs we need to add it to the email even while sending,if check box is set it to true,else we dont need to include that URLs in that email.
AnjunaAnjuna
Hi Sonam,
This is possible. Set a boolean in your controller with default value FALSE. Once the checkbox is checked, make the boolean TRUE.
You are sending emails from apex, right? then set email body as follows.
If(booleanVariable == TRUE){
   //Add the URLs to email body
} else {
   //Set email body
}
Hope this will helps.