Hi I'm pretty new to the salesforce platform so any help would be appreciated. I am trying to create custom email template components, but when I clear out any data from a custom field it wont save the template.

  • Step 1: If I add the new component to the email template and save (without adding anything to the custom fields) it saves fine
  • Step 2: Then I add content to one of the custom fields again saves fine
  • Step 3: If I then clear out the data I just added in the previous step, so that its back to step 1 and save I get the following error

enter image description here

None of the fields I've added are required as I can save on step 1 without entering anything.

I'm trying to achieve a section that allows the user to add a note to an email and if they don't add anything it just displays the default information, I am also expecting the templates to be cloned so it might be a case where the original email has text but the cloned email doesn't require custom text so they need to be able to remove it and save the email template.

HTML markup

                    <template if:true={preambleLeft}>
                    <template if:false={preambleLeft}>
                        <div>for internal only</div>
                <template if:true={htmlVersionUrl}>
                <td >
                    <template if:true={preambleRight}>
                        <div >{preambleRight} <a href={htmlVersionUrl} target="_blank">{preambleLinkText}</a>.</div>
                    <template if:false={preambleRight}>
                        <div >to view the web version, click <a href={htmlVersionUrl} target="_blank">here</a>.</div>


import { LightningElement, api } from 'lwc';

export default class GuidedManualEntry extends LightningElement {


<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
        <targetConfig targets="lightningStatic__Email">
                label="Preamble Text Left"
                description="Enter the text you want to output on the top left"
                required="false" />
                label="Preamble Text Right"
                description="Enter the text you want to output on the top right"
                required="false" />
                label="Preamble Link Text"
                description="Enter the text you want to output for the link"
                required="false" />            
                label="HTML Email Version URL" 
                description="Enter the url of the HTML version of this email ensure secure URL starting with https://"
                required="false" />

1 Answer 1


UPDATE June 2024: The method still works, but now the field has to be filled with a space in the template for saving to take place.

I have exactly the same problem: when the text field is empty, Email Template Builder doesn't set the value to null or empty, but omits it when saving, resulting in a serialization internal error (Error on parameter nodes: java://visualeditor.service.BuilderModelSerializable).

The workaround I've found is to add a space to the string when saving, and to make a template if:true={isLinkDisplayed} with :

get isLinkDisplayed() {
    return !!this.htmlVersionUrl && this.htmlVersionUrl.trim().length > 0;

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .