• Gaurav Shukla Cloudsteer Tech
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 0
    Replies

trigger sendFeedback on Opportunity (before update) {

for(Opportunity b : trigger.new){
  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.setTargetObjectId(recipient.id);  
   //mail.setTemplateId(et.id);  
   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=http://rz-developer-edition.ap1.force.com/CustomerFeedback?id='+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

Force.com Developer

CloudSteer Technology Pvt Ltd..

 

function getDomain()
{
document.getElementById('company').value=document.domain;
}

 

 

This is For Checking Domain ........

 

Gaurav Shukla  

 

CloudSteer Technology Pvt Ltd.