//Get Email Template public async Task <dynamic> GetEmailTemplate(EmailDetailModel model) { EmailResponse response = new EmailResponse(); SecurityToken token = await GetSecurityToken(); var client = new PaymentGateway.IeBizServiceClient(); var template = await client.GetEmailTemplatesAsync(token, "", ""); var temp = template.Where(x => x.TemplateTypeId == model.ebizWebForm.EmailTemplateID).FirstOrDefault(); if (temp?.TemplateTypeId == "WebFormEmail") { model.ebizWebForm.FromEmail = temp.FromEmail; model.ebizWebForm.FromName = temp.FromName; response = await GetEmailPaymentTemplate(model); } else if (temp?.TemplateTypeId == "AddPaymentMethodFormEmail") { model.ebizWebForm.FromEmail = temp.FromEmail; model.ebizWebForm.FromName = temp.FromName; response = await AddPaymentMethodTemplate(model); } return(response); }