Awesome
README
This brings a new Send E-mail Action for Sitecore 9 Forms, enabling the submission of e-mails using MainUtil.SendMail method, which will use an SMTP server to submit e-mails in HTML or Plain Text. When a Send E-mail Action is added to a button in a Form, an E-mail Template has to be selected - this is where the E-mail is configured.
Installation
- Download last packages from https://bitbucket.org/nishtechinc/formssendmail/src/7e943104a21f3d04500ac3713af894ca53da3f57/Sitecore%20Packages/?at=master 2. Package 1 - Sitecore 9 Forms - Send Email Action-1.x.zip - All files and items needed for the Send E-mail Action 3. Package 2 - Sitecore 9 Forms - Test Send Email Form-1.x.zip - Test Send E-mail Form for quick testing the form
- Install Package 1 to have the Action installed
- (Optional) Install Package 2 to have the Test Send-Email Form
- Setup your SMTP server by editing /App_Config/Include/smtp.config and modify it to your SMTP server. Default values will use localhost a port 25, which is good for development with a tool such as SMTP4DEV (https://archive.codeplex.com/?p=smtp4dev)
- <setting name="MailServer" set:value="localhost"/>
- <setting name="MailServerUserName" set:value=""/>
- <setting name="MailServerPassword" set:value=""/>
- <setting name="MailServerPort" set:value="25"/>
- Publish + Reindex
Configurations
Step by Step
- Create an E-mail Templates under /sitecore/system/Settings/Forms/E-mail Templates
- Fill up fields Subject, From, To, Cc, Bcc and either Message RichText or Message Text
- Add Keywords using the syntax: {FieldName} in all of these fields to have them being replaced with data typed by the user at the Form
- Add a Send E-mail Action to your form and select the E-mail Template you created
- Add your form to a Page using the MVC Form Component
- Browse your Form Page, fill the form and submit
If a Send E-mail Action is correctly added to your Form and linked to a valid template,the form will send an e-mail.
E-mail Templates
- E-mail Templates are stored under /sitecore/system/Settings/Forms/E-mail Templates - This is the root folder of the "Select E-mail Template" dialog that appears when the Send E-mail Action is added to a form.
- You can MOVE this folder to anywhere at the Database. The reference to it is setup to this Item ID at core:/sitecore/client/Applications/FormsBuilder/Components/Layouts/Actions/SendEmail/PageSettings/ItemTreeView Check the TDS item at https://bitbucket.org/nishtechinc/formssendmail/src/c746250215d2d5c4a5bdfcfbeafa914b3edd3e50/TDS.Core/sitecore/client/Applications/FormsBuilder/Components/Layouts/Actions/SendEmail/PageSettings/ItemTreeView.item?at=master&fileviewer=file-view-default
- If you want to use another folder item with a different ID, you have to adjust the item above to point to your new ID
Dictionary Items
Dictionary items used at this Action are stored under the Default Global Dictionary of Sitecore, at path /sitecore/system/Dictionary/Forms/Actions/SendMail. You can move these Dictionary Entries to any other Dictionary if you want, and also modify their Texts, just make sure you don't change their Keys so the code can find them.
Test Send Email Form
If you installed the second package and want to use the Test Send E-mail Form, make sure to add an MVC Form Rendering (/sitecore/layout/Renderings/System/Forms/Mvc Form) to a placeholder in a page. After that, you can Preview the item with the Test Form and submit to have the E-mail message being sent.
Debug
- If anything goes wrong the Exception will be logged to Sitecore log files with the following pattern:
- [SendMail Action] Error sending e-mail based on template {ID}
Implementation
Please check this article (yet to come) for details on the implementation.
What is this repository for?
- Implemenetation of Sitecore 9 Forms - Send E-mail Action
- Documentation of the action implementation
- Release of Sitecore Packages under https://bitbucket.org/nishtechinc/formssendmail/src/c746250215d2d5c4a5bdfcfbeafa914b3edd3e50/Packs/?at=master
Who do I talk to?
- Rodrigo Peplau - rpeplau@nishtechinc.com