#if ($showAttachments) ${attachments} #set( $counter = 0 ) #foreach( $attachment in $resolvedattachments ) ## add delimiter when there is more than one reference #if( $counter > 0 ) ,  #end ---- ${attachment.name} #set( $counter = $counter + 1 ) #end ---- #end