change id used for frontend emails

was using unique database id rather than the programme id