public void GetEmailToAddresses_ShouldReturnListOfToEmailAddress()
        {
            // Act
            var result = _actionHelper.GetEmailToAddresses(_formSchema.FormActions.FirstOrDefault(), _mappingEntity.FormAnswers);

            // Assert
            Assert.Equal("[email protected],[email protected],", result);
        }
        public override async Task Process(IActionHelper actionHelper, IEmailProvider emailProvider, FormAnswers formAnswers)
        {
            var message = new EmailMessage(
                this.Properties.Subject,
                this.Properties.Content,
                this.Properties.From,
                actionHelper.GetEmailToAddresses(this, formAnswers));

            await emailProvider.SendEmail(message);
        }
        public override Task ProcessTemplatedEmail(IActionHelper actionHelper, ITemplatedEmailProvider templatedEmailProvider, Dictionary <string, dynamic> personalisation, FormAnswers formAnswers)
        {
            var emailAddressList = actionHelper.GetEmailToAddresses(this, formAnswers).Split(',').ToList();

            foreach (var emailAddress in emailAddressList)
            {
                templatedEmailProvider
                .SendEmailAsync(emailAddress, Properties.TemplateId, personalisation);
            }

            return(null);
        }