Sending Document as an attachment in the form of Pdf Using Workflow Rules of force.com platform and Visualforce Template feature
This requirement can be easily accomplished through workflow rules and the Visualforce Email Templates
In this blog POST will walk through on how to approach this
Creation of Email Field This is the first step to create an Email Field so that when we develop workflow rules when for the email alert the Recipient Type is asked we may fill in the email field
Creation of workflowThis is a simple step where based on business criteria draft a workflow rule.Usually rule should be to trigger the email alert only if the boolean flag is checked .
Step 3:Creation of email template The email Template will be a visualforce template and hence if you are familiar with visualforce this must be a straight forward impementation
Below is the sample code that you may customize by replacing with your relevant object name
Please find your receipt attached with this mail. <!-- Section to insert header-
Label1 Label 2 Label 3
Image From Notes and Attachment
If have any image to display from documents then you will have to use the following
https://AAA.salesforce.com/servlet/servlet. ImageServer?id=BBB&oid=CCC AAA = your SFDC server, found in the URL of any SFDC link after you log in BBB = the record ID of your publicly available document CCC = your organization ID You can pull from documents.Dont pull from static Resource .It never works .
I answered couple of questions in stackexchange recently and this promoted me to write this blog post so that may help .