...
HOWEVER! Visualforce email templates take time! Allow yourself time!.
Visualforce tips
Custom Settings
Store details that are used in multiple email templates in Custom Settings - eg, you have a knowledge base article that you refer to regularly - store that in a custom setting. If the KB article link ever changes, you only change it in one place.
...
Code Block | ||
---|---|---|
| ||
<img src="{!relatedTo.Campaign.EmailImage__c}"/> |
Conditional text
display a paragraph on your email if X = true - eg if the Campagin start date is upcoming, then put the how to get there blurb in, otherwise put the please give us your feedback blurb. Use this code. Only one of the paragraphs will display.
...
See some more ideas on this here http://salesforce.stackexchange.com/questions/18603/rendering-output-panel-if-list-is-not-null and http://www.laceysnr.com/2011/10/using-rerender-to-render-one-solution.html
Conditional HTML elements
Going one further than above - if you have a list of items some of which are conditional, then use this.
Code Block |
---|
<ul>
<apex:variable var="vargoogle" rendered="{!relatedTo.ShowGoogle__c = true}" value=""><li><apex:outputlink value="http://google.com">Google</apex:outputlink></li></apex:variable>
<apex:variable var="varbing" rendered="{!relatedTo.ShowBing__c = true}" value=""><li><apex:outputlink value="http://bing.com">Bing</apex:outputlink></li></apex:variable>
</ul> |
How cool is that! Thank you for this suggestion on Salesforce Stack Exchange.
Numbers
You need to output a number in a specific format.
...