function readOnly(count){ }
Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
trigger sendemail on FeedComment(after insert) { for(FeedComment F: trigger.new){ if(f.Status=='Select as Best') { user u=[select firstname,lastname from user where id=:f.InsertedById limit 1]; Messaging.SingleEmailMessage message = new Messaging.SingleEmailMessage(); message.toAddresses = new String[] { 'Saurabh.dua@hotmail.com' }; message.optOutPolicy = 'FILTER'; message.subject = 'New Case Feed'; message.HTMLBody = '<b>Message Body:</b>' +f.body + '<b>Created by:</b>' + u.firstname+' '+u.lastname; Messaging.SingleEmailMessage[] messages = new List<Messaging.SingleEmailMessage> {message}; Messaging.SendEmailResult[] results = Messaging.sendEmail(messages); } } }
The Status picklist field of FeedComment object has a Select as Best option. You can send email to the user based on this value
Here is a sample code
If you find this information helpful, please mark this answer as Best. It may help others in the community
Regards,
Anudeep