I am attempting to add dynamic content to an email and want to remove the velocity syntax from the email body and replace it with a $var by using the #set directive like this:
#if('x' = 'y') #set($z = 'z') #elseif( 'a' = 'b') #set($c = 'c')
This was my attempt:
#if( {$date_opened_5ca62c21c455a} == "" && {$firstName} != "" )
#set($header_greeting = "{$firstName}, Community Member.")
#elseif( {$date_opened_5ca62c21c455a} != "" && {$firstName} != "" )
#set( $header_greeting = "{$firstName}, member since
{$date_opened_5ca62c21c455a}")
#else
#set( $header_greeting = "Building Tomorrow Together" )
#end
I received an error saying a closing ) was expected
I also took a shot in the dark with:
#set( $header_greeting = "#if( {$date_opened_5ca62c21c455a} == "" && {$firstName} != "" ){$firstName}, Community Member.#{elseif({$date_opened_5ca62c21c455a} != "" && {$firstName} != "")}{$firstName}, member since {$date_opened_5ca62c21c455a}#{else}Building Tomorrow Together#end" )