I'm using a Velocity script to personalize content in my email that says Member since: XXXX where XXXX=year. Currently, I'm hiding Member since: XXXX for anything earlier than 2007. How do I adjust this to also hide anything later than 2020? In other words, I only want to show the content if the year is between 2007 and 2020.
#if ( $convert.toNumber($lead.HCMemberSince) >= 2007 )
Member since: ${lead.HCMemberSince}
#end
Solved! Go to Solution.
No need for anything special, just the && (AND) operator:
#set( $HCMemberSince = $convert.toNumber($lead.HCMemberSince) )
#if ( $HCMemberSince >= 2007 && $HCMemberSince <= 2020 )
Member since: ${HCMemberSince}
#end
Works beautifully - thank you, @SanfordWhiteman!