added letter template functionality