Class Frontend
- Namespace
- Dynamicweb.Forms
- Assembly
- Dynamicweb.Forms.dll
Class Frontend.
- Inheritance
-
Frontend
- Implements
- Inherited Members
Methods
CreateMailMessage(string, string, string?, string, string, string?, string?, string?)
Creates the mail message.
public MailMessage? CreateMailMessage(string subject, string body, string? fromName, string fromEmail, string to, string? cc, string? bcc, string? replyto)
Parameters
subject
stringThe subject.
body
stringThe body.
fromName
stringFrom na
fromEmail
stringFrom email.
to
stringTo.
cc
stringThe cc.
bcc
stringThe BCC.
replyto
string
Returns
- Mail
Message System.Net.Mail.MailMessage.
GetMaxSubmit()
Gets the maximum submit.
Returns
- int
System.Int32.
GetModuleContent()
Override this method and return the HTML output for the module.
Returns
- Output
Result Must return the markup that renders the module.
Examples
using Dynamicweb.Extensibility.AddIns;
using Dynamicweb.Frontend;
using Dynamicweb.Modules;
namespace Dynamicweb.Examples;
[AddInName("ModuleSystemName")]
public class ContentModuleSample : ContentModule
{
public override OutputResult GetModuleContent()
{
//Get an instance of a template object
var template = new Dynamicweb.Rendering.Template("ModuleSystemName/Template.cshtml");
//Set a tag named "Text" with the value from the HelloText property
template.SetTag("Text", Properties.Values["HelloText"].ToString());
//Add the page id executing the page with the paragraph where this module is attached
template.SetTag("PageID", Pageview?.ID ?? 0);
//Return the parsed template to the event handler
return new ContentOutputResult
{
Content = template.Output()
};
}
}
Remarks
The markup returned is what is inserted into the template tag ParagraphModule
in the paragraph template.
GetSubmitCount()
Gets the submit count.
Returns
- int
System.Int32.
HandleMaxSubmitCountAction()
Returns
MaxSubmitsReached(Form)
Checks the submit count.
Parameters
form
Form
Returns
RenderForm()
Renders the form.
Returns
- Output
Result System.String.
RenderMail(Submit)
Renders the form mail (website owner) to the Forms/Mail/*.cshtml|HTML template.
Parameters
submit
SubmitThe submitted data to render to the mail template.
Returns
- string
A string of email body in HTML.
RenderMailTemplate(Template, Submit)
Renders the receipt template.
Parameters
RenderReceipt()
Renders the receipt.
Returns
- string
System.String.
RenderReceiptMail(Submit)
Renders the receipt mail to the Forms/Mail/*.cshtml|HTML template.
Parameters
submit
SubmitThe submitted data to render to the mail template.
Returns
- string
A string of email body in HTML.
RenderReceiptTemplate(Template, Submit)
Renders the receipt template.
Parameters
SaveForm()
Saves the form.
Returns
- Output
Result System.String.
SaveFormFiles(Field)
Saves the files submitted with a form.
Parameters
currentField
FieldThe file upload field.
Returns
- string
System.String.
SendMail(Submit)
Sends the mail.
Parameters
submit
SubmitThe s.
SendReceiptMail(Submit)
Sends the receipt mail.
Parameters
submit
SubmitThe s.