function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Shay HoweShay Howe 

HTML Email Conditional Statement with a Custom Field

I am looking to set up a conditional statement within an HTML email that only displays a custom field if a vaule within the custom field exist.

 

For example...

 

IF there is a value for the custom field "price" then display:

 

HTML Heading.

HTML Paragraph including the custom field.

 

ENDIF

 

If there is no value for the custom field "price" then nothing is to be shown.

 

Any input or advice here would be greatly apprecaited.

 

Thanks!

 

 

jackeejackee

Are you using VF page or just HTML

 

For HTML below is the code :

 

</script>

<script type="text/javascript">
//If the time is less than 10, you will get a "Good morning" greeting.
//Otherwise you will get a "Good day" greeting.

var d = new Date();
var time = d.getHours();

if (time < 10)
  {
  document.write("Good morning!");
  }
else
  {
  document.write("Good day!");
  }

 

 

You will have to use the standard controller or customer controller and then write the page based on that. 

 

I think you should go with formula ... in this case