Velocity - multiple sessions - remove session dynamically from email body
Hello!
I am looking for a neat solution in order to control dynamic display of event sessions, in email inviation.
Email body will have following table with sessions listed i.e.
Session 1 - APR 12th 2020
Session 2- APR 20th 2020
Session 3 - APR 20th 2020
Same invite will be sent before Session 2 and the list should only show:
Session 2- APR 20th 2020
Session 3 - APR 20th 2020
I was thinking of implementing below solution based on Sanford's blog post:
#set( $calSession1 = $convert.toCalendar(
$convert.parseDate(
"2020-04-04T00:00:00", //First invite
$ISO8601DateTime,
$defaultLocale,
$defaultTimeZone
)
) )
#set( $calEndSession1 = $convert.toCalendar(
$convert.parseDate(
"2017-04-12T00:00:00",
$ISO8601DateTime,
$defaultLocale,
$defaultTimeZone
)
) )
#if( $calNow.compareTo($calSession1) >=0 && $calNow.before($calEndSession1) )
Session 1 - APR 12th 2020
Session 2- APR 20th 2020
Session 3 - APR 20th 2020
#else
REPEAT THE ABOVE WITH NEW DATES?
#endshould I repeat the above when Session 1 expires and when another invite is sent, starting from Session 2?
Appreaciate your help.
Thanks,
Kacper