Try our conversational search powered by Generative AI!

XForm Output - How to Style



When the XForm sends an email out - is there any files/assembly/code that EPiServer uses that determines how this looks when it is outputted? If so, where is it!?

We wish to customise it, so wondering where to start?


Apr 26, 2012 10:46

First you need to create an initialization module as a container for your override code. You will find details of how to do this here:

Make sure your module is dependent on the EPiServer.Web.InitializationModule using the ModuleDependency attribute:


In the Initialize method of your module you can add the following code to customize the email output:

BaseLibrary.Channel.IChannel channel = new SynchronousChannel("xformdata");

EPiServer.XForms.Implementation.EMailConnection emailSender = new EPiServer.XForms.Implementation.EMailConnection();

emailSender.Subject = "MySubject"

emailSender.XMailer = "EPiServer XForms";

emailSender.XsltUrl = url to an Xslt file that transforms the XML Document containin the post;
emailSender.From = "";
emailSender.To = "";

channel.SendEvent += new BaseLibrary.Channel.ChannelEventHandler(emailSender.SendEmail);

channel.SendEvent += new BaseLibrary.Channel.ChannelEventHandler(new EPiServer.XForms.Implementation.HttpConnection().HttpRepost);

channel.SendEvent += new BaseLibrary.Channel.ChannelEventHandler(XForms.XFormData.SaveEventHandler);




Please note that I have not compiled or tested this code :-)

Apr 27, 2012 15:08
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* 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.