Episerver Forms - Send different emails based submitted values

Vote:
 

Hi

It woud be great to be able to send different emails based on the values submitted on a form. For example if a user selects an Enquiry Type of 'Complaint' they would receive a different automated reply to a user that submitted 'General Feedback'.

Cheers

Jonathan.

#231494
Nov 29, 2020 22:21
Vote:
 

You could extend ActorsExecutingService and override GetFormSubmissionActors.

In the override, you could call:

base.GetFormSubmissionActors(submission, formContainer, formIden, request, response, isFormFinalizedSubmission).ToList();

Then check if the returned list contains a SendEmailAfterSubmissionActor. If it does, check the submitted data, and update the EmailTemplateActorModel's property ToEmails, and return the list.

Finally tell Episerver to use your implementation instead of ActorsExecutingService. Can be done using StructureMap.

#231538
Edited, Nov 30, 2020 17:24
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.