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
krishna23krishna23 

How to send email template to opportunity team after approving the quote

I want to send email template information to opportunity team members respective parent quote information after approving the quote.
email template has quote id and quote URL.

Thanks......
 
Khan AnasKhan Anas (Salesforce Developers) 
Hi Krishna,

Greetings to you!

I tried to research your requirement and found that this is still an idea to send email to opportunity team members when the quote moves to approval status.

https://success.salesforce.com/ideaView?id=08730000000kzQ0AAI

https://success.salesforce.com/ideaView?id=08730000000BpuhAAC

https://success.salesforce.com/ideaView?id=08730000000Dh7UAAS

You can also upvote this idea so that we can get this feature in the future.

I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks and Regards,
Khan Anas
krishna23krishna23
Thanks, Anas for the quick response
I want to send mail using Apex code to opportunity teams with parent information. Could you please help me it would very helpfull for me.

Thanks......
Kranthi Kumar 118Kranthi Kumar 118
Hi Krishna,

Please check the below link, this might help you..

https://developer.salesforce.com/forums/?id=906F000000090G6IAI

Thansk and Regards,
Kranthi
Raj VakatiRaj Vakati
Use this sammple code 
 
Trigger QuoteTriggers on Quote ( after update) {
 
Map<Id , Quote> oppIds = new Map<Id,Quote>(); 
 for(Quote q : trigger.new){
 if (q.Status =='Approved') {   
     oppIds.put(q.OpportunityId ,q) ;   
  }
 }
 
 List<OpportunityTeamMember> tems = [ SELECT Name, TeamMemberRole, User.Email FROM OpportunityTeamMember WHERE OpportunityId IN  oppIds.keySet()] ; 
 
 	OrgWideEmailAddress owa = [select id, DisplayName, Address from OrgWideEmailAddress limit 1];
EmailTemplate templateId = [Select id from EmailTemplate where name = 'Waitlisted opportunity now open'];
 List<Messaging.SingleEmailMessage> allmsg = new List<Messaging.SingleEmailMessage>();

 for(OpportunityTeamMember op : tems){
	 

Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
mail.setTemplateID(templateId.Id); 
mail.setSaveAsActivity(false);
mail.setOrgWideEmailAddressId(owa.id);
allmsg.add(mail);
	 
 }
 
 Messaging.sendEmail(allmsg,false); 

 
}