I want to attach a pdf in a salesforce email by selecting an email template.I have created one visualforce template by which I am able to attach the pdf to the mail.But my requirement is user can edit the email body like the html template and the attached pdf will get refreshed reflecting the changes,Appreciate your help!

  • 2
    Can you make a (large) text field on the object, call it "Email Notes" or something? They'd have to fill it in before they click "send an email & pick template" though
    – eyescream
    Dec 17 '13 at 14:54
  • If I will make any large text field.How it can be used as a email template? Dec 26 '13 at 9:41
  • By simply using the field APi name in that template, like any other field coming from the object? {!relatedTo.Email_Notes_field__c} or something... Just put this reference both in the email body and in the PDF attachment's section.
    – eyescream
    Dec 27 '13 at 1:37
  • We need to provide user to edit the template as in case of html template.I deisgned one visualforce template with email body and attachment.Things are working fine.When user select a template pdf is getting attached to the email.But user will not be able edit the visualforce template. Dec 27 '13 at 9:42

Make the email by rendering a Visualforce page as a pdf. There is lots of sample code if you search Developerforce for Email - with quote2pdf, sending SingleEmailMessage, and more.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.