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
Gaurav Shukla  Cloudsteer TechGaurav Shukla Cloudsteer Tech 

How to Visualforce page Update Through A site

trigger sendFeedback on Opportunity (before update) {

for(Opportunity b :{
  if(b.Interested_In_Feedback__c == true && b.Feedback_Received__c == false && b.Shipment_Status__c == 'Delivered'){
   Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();  
   Contact recipient = [SELECT id,firstname from Contact where id=:b.Customer__c];  
   //EmailTemplate et = [SELECT id FROM EmailTemplate WHERE developerName = 'CustomerFeedbackRequest'];  
   mail.setSenderDisplayName('FeedBack System');  
   mail.setSubject('Feedback Request');
   //mail.setPlainTextBody('Dear' +recipient.FirstName + ' Sir or Madam');
   mail.setHtmlBody('Dear ' +recipient.FirstName +
                    '<p>Thank you for your interest in providing your valueable Feedback <p> Please click the link below <p>'+ 
                    '<a href='+b.Customer__c+'&bid='+b.Id+'>FeedBack Request Link</a>'+
                    '<p> Thanks And Regards <p> Feedback Team');

   Messaging.sendEmail(new Messaging.SingleEmailMessage[] {mail}); 



Gaurav Shukla Developer

CloudSteer Technology Pvt Ltd..


Best Answer chosen by Admin (Salesforce Developers) 

If you are looking to share code samples, please submit them to the Cookbook section of, and not the discussion boards.