[% IF report.get_extra_metadata('grouped_ids') %] Your reference numbers LBS-[% report.id %], LBS-[% report.get_extra_metadata('grouped_ids').join(', LBS-') %] [% ELSE %] Your reference number LBS-[% report.id %] [% END %]