I have been attempting to enter an Email Template for a couple of days now. Each time I create a Visualforce email template and fill out the required fields. I then enter the body of my email and click Save. When I query for the email template using the following query:
select id, htmlvalue, body, name from emailtemplate where name = 'emailTemplateNameHere'
the htmlvalue comes back as blank despite me using <messaging:htmlEmailBody>
tags in my body.
I queried again this morning to make sure nothing had changed over the weekend and the HtmlValue
was still blank. I entered another Email Template, re-queried to check if it had an HTML body and saw (since I used select id, htmlvalue, body, name from emailtemplate where name like '%partOfNameHere%')
that the new record had a blank HtmlValue, but the HtmlValue for my new record was blank.
It is also important to mention that when I run code that attempts to select the HtmlValue it also gets a blank value. This has been preventing me from working on a project for a few days now, does anyone have any suggestions? Thanks ahead of time!
markup
field - see developer.salesforce.com/docs/atlas.en-us.object_reference.meta/… – cropredy Oct 19 '15 at 17:24emailTemplate
- the ones of type html always hadhtmlValue
but only some of my VF templates had values inhtmlValue
. 'markup` is present for all VF templates and never for html templates. Of course, this OP begs the question as to why you need to read the html? If you are trying to prerender the template, there are better ways – cropredy Oct 20 '15 at 0:41