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
public class sendAnEmail { @InvocableMethod(label='Send an email from apex class' description='sends an email') public static void sendEmailWithAttachment(List<id> listofQuoteHeader) { for(Id QuoteHeaderid :listofQuoteHeader) { PageReference pref= page.Quote_PDF; pref.getParameters().put('id',(Id)QuoteHeaderid); pref.setRedirect(true); Attachment attachment = new Attachment(); Blob b=pref.getContentAsPDF(); attachment.Body = b; attachment.Name = Datetime.now().format('yyyy-MM-dd HH:mm') + ' ' + 'Quote' + '.pdf'; attachment.IsPrivate = false; attachment.ParentId = QuoteHeaderid; insert attachment; Messaging.SingleEmailMessage semail= new Messaging.SingleEmailMessage(); Messaging.EmailFileAttachment attach= new Messaging.EmailFileAttachment(); attach.setBody(pref.getContentAsPDF()); semail.setSubject('Quote Issued'); String[] emailIds= new String[]{'**********@gmail.com'}; semail.setToAddresses(emailIds); semail.setPlainTextBody('Please find the attached quote details'); semail.setFileAttachments(new Messaging.EmailFileAttachment[]{attach}); Messaging.sendEmail(new Messaging.SingleEmailMessage[]{semail}); } } }
Please check once the following link, hope this will helps you.
https://automationchampion.com/tag/send-an-email-process-builder/
Hope this helps you!
If my answer helps resolve your query, please mark it as the 'Best Answer' & upvote it to benefit others.
Thanks
Varaprasad
@For Support: varaprasad4sfdc@gmail.com
how to send email using process builder and also using apex class can any one explan
Please check sample code below.
Please check once below links also :
https://www.linkedin.com/pulse/sending-email-attachment-using-process-builder-shweta-soparkar-/
Hope this helps you!
If my answer helps resolve your query, please mark it as the 'Best Answer' & upvote it to benefit others.
Thanks
Varaprasad
@For Support: varaprasad4sfdc@gmail.com