Sitecore 8 Web Forms For Marketers (WFFM) email settings cheat sheet

Search for a command to run...

No comments yet. Be the first to comment.
Polly is great library for easily configuring different kinds of policies around code execution, be it retry, circuit breaker, caching or lots of other things. It's probably most often used around HTTP requests. If you haven't heard about it you defi...

This is part 2 of my series on unit testing in .NET (C#) and will be about my conventions regarding naming unit tests, how to structure them and which parts to test. And lastly I will help you increase readability of assertions and potential error me...

I feel like unit testing is very important and very beneficial in a lot of ways. It helps with not breaking existing functionality and thereby also making you more confident in changing code without fear of breaking important stuff. Often it also mak...

I've been working with Swagger through NSwag a lot recently and also needed to get it to work when hidden behind a reverse proxy - i.e. another service forwarding a request to the service exposing the Swagger UI. Some of the issues I've had along the...

The other day I was writing a unit test to verify what was supposed to happen when a Task would throw an exception when awaited. It wasn't as straight forward as I first assumed, but I quickly found this Stack Overflow post that helped me: https://st...

I've just been working with WFFM a bit - migrating forms from Sitecore 6.5 - and had to also set it up to use TLS for the mail server.
This post is basically just a cheat sheet of the email options that can be configured and where you can configure them.
The official documentation explains the basics like mail server and credentials etc. but it's missing a few bits.
On the item /sitecore/system/Modules/Web Forms for Marketers/Settings/Actions/Save Actions/Send Email Message in the Parameters field you can specify values (as XML) for the following settings:
<Host>smtp.domain.com</Host>
<Port>587</Port>
<Login>user@domain.com</Login>
<Password>b</Password>
<From>user@domain.com</From>
<EnableSsl>true</EnableSsl>
<IsBodyHtml>true</IsBodyHtml>
<IsIncludeAttachments>false</IsIncludeAttachments>
<!-- Not mentioned in official docs but should work as well -->
<Subject>Default subject</Subject>
<Mail>Default email body</Mail>
<CC>user@domain.com</CC>
<BCC>user@domain.com</BCC>
<LocalFrom></LocalFrom>
<RecipientGateway></RecipientGateway>
<FromPhone></FromPhone>
It's only a subset of these settings that can be specified in config files. Values specified on the save action item itself will override any values from config files. Settings like EnableSsl, IsBodyHtml and IsIncludeAttachments can sadly only be specified on the save action although it should be somewhat trivial to change this, potentially by hooking into the processMessage pipeline.
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:set="http://www.sitecore.net/xmlconfig/set/">
<sitecore>
<settings>
<setting name="MailServer" set:value="smtp.domain.com" />
<setting name="MailServerPort " set:value="587" />
<setting name="MailServerUserName" set:value="user@domain.com" />
<setting name="MailServerPassword" set:value="b" />
<!-- Corresponds to <From> - default sender address -->
<setting name="Analytics.EMailFromAddress" set:value="user@domain.com" />
</settings>
</sitecore>
</configuration>
Most of the forms created with the earlier version of WFFM had <Host> and <From> parameters with the default values specified on the form itself in the Save Actions field. These were overriding anything specified in either config files or on the save action item. To fix this we had to manually edit the XML of the Save Actions field on all the forms.
The old forms also had a reference to the old Save to database save action (that no longer exists after 8.0) which we also had to remove.
I created this .aspx page/script to do this for us - use at your own risk!