[% SET container = report.get_extra_field_value('Paid_Collection_Container_Type'); IF container; SET sacks = (container == 2); SET quantity = report.get_extra_field_value('Paid_Collection_Container_Quantity'); ELSE; SET container = report.get_extra_field_value('Subscription_Details_Containers'); IF container; SET sacks = (container == 28); SET quantity = report.get_extra_field_value('Subscription_Details_Quantity'); END; END; SET new_bins = report.get_extra_field_value('new_containers') || 0; SET pro_rata = report.get_extra_field_value('pro_rata'); SET payment = report.get_extra_field_value('payment'); SET admin_fee = report.get_extra_field_value('admin_fee'); SET total = 0; IF pro_rata; SET total = pro_rata + (admin_fee||0); ELSIF payment; SET total = payment + (admin_fee||0); END; IF report.title == 'Garden Subscription - Renew'; SET type = 'renew'; ELSIF report.title == 'Garden Subscription - New'; SET type = 'new'; ELSIF report.title == 'Garden Subscription - Amend'; SET type = 'amend'; ELSIF report.title == 'Garden Subscription - Cancel'; SET type = 'cancel'; END; IF type == 'renew'; SET email_summary = "Thank you for renewing your subscription to " _ cobrand.council_area _ "’s garden waste collection service."; SET renew_year_end = report.created.year + 1; ELSIF type == 'cancel'; SET email_summary = "You have cancelled your garden waste collection service."; ELSIF type == 'amend'; SET email_summary = "You have amended your garden waste collection service."; ELSE; SET email_summary = "Welcome to " _ cobrand.council_area _ "’s garden waste collection service."; END; ~%]