The form below will add a new subscribed contact to your database, and display a pop-up message on success.
The attribute ContactMode="register" is set on the <forms:form>
UI control, which will register a new contact, and throw a validation error if the contact already exists.
<h4>Sign Up</h4>
<p>Enter your details to receive e-mail updates from us.</p>
<forms:form id="blog_signup_sidebar" onsuccesstoastmessage="Thanks! You have been successfully signed up" contactmode="register">
<forms:row label="* First and Last Names:">
<forms:editbox id="contact_first_name" width="70" validations="mandatory" /> <forms:editbox id="contact_last_name" width="133" validations="mandatory" />
</forms:row>
<forms:row label="* Email Address:">
<forms:editbox id="contact_email" width="240" validations="mandatory,email" transformations="tolower" />
</forms:row>
<forms:row type="one_column">
<forms:submitbutton value="Sign Up" />
</forms:row>
</forms:form>
Request Marketing Consent
Contacts added to your database via other forms (such as contact forms), will be aded with the e-mail marketing status
"Pending" to flag inferred consent.
Adding to the previous contact enquiry form article, you can explicitly ask
users whether they want to receive e-mail newsletters, and set their e-mail marketing status to "subscribed" (line 12-14):