Added a function to handle mandrill template