You need to sign in to do that
Don't have an account?
Warren Wade
Visualforce Error: "Invalid child of messaging:emailTemplate."
I'm receiving the following error for what I hope will be a simple Case Created Email Template:
Below is my VF Template. Any help would be appreciated. I'm new to writing apex.
Only messaging components are allowed as children of messaging:emailTemplate.
Below is my VF Template. Any help would be appreciated. I'm new to writing apex.
<messaging:emailTemplate subject="Test Case Creation" recipientType="Contact" relatedToType="Case"> replyTo="email@address.com" > <messaging:htmlEmailBody> <html> <body> <STYLE type="text/css"> TH {font-size: 11px; font-face: arial;background: #CCCCCC; border-width: 1; text-align: center } TD {font-size: 11px; font-face: verdana } TABLE {border: solid #CCCCCC; border-width: 1} TR {border: solid #CCCCCC; border-width: 1} </STYLE> <p>This is an automated confirmation to confirm that we have received your case. When you receive future emails regarding this case, please respond directly to that email thread. In doing so, you will ensure that your email is logged against the appropriate case. </p> <TABLE border="0"> <TR> <TD>Case Number</TD> <TD><apex:outputtext>"{!relatedTo.CaseNumber}"</apex:outputtext></TD> </TR> <TR> <TD>Subject</TD> <TD><apex:outputtext> value="{!relatedTo.Subject}"</apex:outputtext></TD> </TR> <TR> <TD>Priority</TD> <TD><apex:outputtext> value="{!relatedTo.Priority}"</apex:outputtext></TD> </TR> <TR> <TD>Description</TD> <TD><apex:outputtext> value="{!relatedTo.Description}" </apex:outputtext></TD> </TR> <TR> <TD>Reference Code</TD> <TD><apex:outputtext> value="{!relatedTo.Reference_Field__c}" </apex:outputtext> </TD> </TR> </TABLE> <p>You can expect a response from our staff member within 2 business days. Our goal is to resolve your case within 5 working days depending on the level of complexity and urgency. If you wish to Escalate this case, please respond to this or an email within the cases thread with the subject "Escalate".</p> </body> </html> </messaging:htmlEmailBody>> </messaging:emailTemplate>
Try with below code. That should help
Thanks for your response. I inserted your code and noticed that you added some lines for the reference field; however, the issue I'm currently facing is the error message (below). Do you have any insight into this error?
If you closely look at the visualforce template that you initially posted, you'll find that template is not correctly compiled because of some typo's like
<apex:outputtext> value="{!relatedTo.Subject}"</apex:outputtext>
In the example above, value attribute is not placed correctly, i.e. it should be part of the outputtext tag and not placed between the start and close outputtext tags.
Similarly, you have few more typo's in your template and hence you get this error.
Hope that answers your question.