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
bobby7bobby7 

Task on regarding after insert , after update trigger on contact

My requirment is to send a PDF attachment of all contact details to the mail id which is entered in Email field on contactwhen the record is inserted or record is updated.

 

Plzzz help me out frnds ....!!!!

APathakAPathak

Hi,

My approach would be the following :-

 

1. Make the VF email template like this :-

 

<messaging:emailTemplate subject="Test" recipientType="Contact" relatedToType="Contact">
<messaging:plainTextEmailBody >

Hi, Please see the attached PDF!

<messaging:attachment renderAs="PDF" filename="PDFattachment.pdf">
<!-- Contact Details -->
Contact name :- {!relatedTo.name}
Contact Address :- {!relatedTo.MailingAddress}


</messaging:attachment>
</messaging:emailTemplate>

 

2. Send email using massemail or singleemail message. Use the above template to prepare the email.

 

 

vishal@forcevishal@force

You can also use workflow rule here.

 

1. Create a new email template which has the needed contact details, add an attachment to it.

2. Create a workflow rule which sends an email to Contact.Email on Contact using the new template you created.