0

I am facing the below error while creating the VisualForce Email Template.

Why?

Error

Error Error: Invalid child of messaging:emailTemplate. Only messaging components are allowed as children of messaging:emailTemplate.

Template

<messaging:emailTemplate subject="Legal Case" recipientType="User" >
    <messaging:htmlEmailBody >
    </messaging:htmlEmailBody >

    /*<messaging:plainTextEmailBody >
        Congratulations!
        This is your new Visualforce Email Template.
    </messaging:plainTextEmailBody> */
</messaging:emailTemplate>
1

The issue is occurring because you are commenting your code like apex class with "/**/" sign.

As it Visualforce email template it should be commented like visual force page like below : -

<messaging:emailTemplate subject="Legal Case" recipientType="User" >
    <messaging:htmlEmailBody >
    </messaging:htmlEmailBody >

<!--<messaging:plainTextEmailBody >
Congratulations!
This is your new Visualforce Email Template.
</messaging:plainTextEmailBody>-->
</messaging:emailTemplate>

then it will be working.In my DE it is working.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.