Skip to content

Instantly share code, notes, and snippets.

@tyoshikawa1106
Last active December 24, 2015 00:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tyoshikawa1106/6715670 to your computer and use it in GitHub Desktop.
Save tyoshikawa1106/6715670 to your computer and use it in GitHub Desktop.
Visualforceメールテンプレートで使用する<messaging:emailTemplate>のサンプル。
<messaging:emailTemplate subject="Your account's cases" recipientType="Contact" relatedToType="Account">
<messaging:htmlEmailBody >
<html>
<body>
<p>
<apex:outputText value="おめでとうございます!" />
<br/>
<apex:outputText value="これが新しい Visualforce メールテンプレートです。" />
</p>
</body>
</html>
</messaging:htmlEmailBody>
<messaging:attachment renderAs="PDF" filename="Contact.pdf">
<html>
<body>
<p><apex:outputText value="You can display your 「{!relatedTo.Name}」 cases as a PDF" /></p>
</body>
</html>
</messaging:attachment>
<messaging:attachment filename="cases.csv" >
<apex:repeat var="cx" value="{!relatedTo.Cases}">
"{!cx.CaseNumber}","{!cx.Subject}","{!cx.Contact.email}","{!cx.Status}"
</apex:repeat>
</messaging:attachment>
</messaging:emailTemplate>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment