Customize Mails - 2sic/app-mobius-forms GitHub Wiki
Overview to Customizing Mails
Check out the razor files in the email-templates folder, and you'll see that these contain a section which generates the body, and a function which generates the subject. You can:
- Customize these files as you need them
- Create new copies of these files, in case you want different mails for different uses
The default setup already does
- sends to the site owner and the customer...
- using fully templated e-mails based on Razor templates
- both subject and body are templateable
- you can set a different Reply-To address
- you can also CC both the customer and owner mail to more people
Create/Use Additional E-Mail Templates
Just copy the files you want in the email-templates folder. To make your form use it, you can:
- either go to the specific form, and in the edit-dialog, type in the name of the template to be used
- go to the App-Settings and change the default template file for owner and/or customer
Customize the E-Mail Subject
The basic implementation is simple: the subject is taken from the form configuration or if missing, uses a default subject configured in the app settings. You can change this to anything you want, using simple C# string function like String.Replace or String.Format
Customize the E-Mail Body/Message
The basic implementation just sends a mail with all fields to the owner, and a simple thank-you message to the customer. Just customize this as you need it.