Email templating script