I'm trying to understand the VisualForce code below to see what was written & is causing the error above:
<messaging:emailTemplate subject="Your Offering Listing" recipientType="Contact" relatedToType="vlocity_ps__InventoryItem__c"> <messaging:htmlEmailBody> <html> <body> <p> Congratulations! </p> <p> This is your new Visualforce Email Template, which displays the photos relating to your listing. </p> </body> </html> </messaging:htmlEmailBody> <center> <apex:outputLink value="https://dev-xyz.cs20.force.com"> For more detailed information login to the Portal here to see your listing. </apex:outputLink> </center> </messaging:emailTemplate>
The goal is to add attachments from an object record to the E-Mail template under the "Congratulations" verbiage. However, in order to do this I need to fix this error first, which is displayed when trying to save the VF E-Mail template.
"Error: Invalid child of messaging:emailTemplate. Only messaging components are allowed as children of messaging:emailTemplate."
I'm looking for advice on:
- The error above.
- How to add attachments from an object record's "Attachments" related list.