Add template treatment to mail sending webscript