To generate PDF message attachment in Visualforce email templates, add the following code snippet:
1 2 |
<messaging:attachment renderAs="pdf" filename="{!relatedTo.name}"> </messaging:attachment> |
Filename – is a name of your document. You can make it static:
1 |
filename="Conditions of services" |
Or dynamic and addressed to your client:
1 |
filename="Conditions of services for {!relatedTo.name}" |
After put any code snippet inside. You can create your HTML page or simple text in your PDF email attachment.