Usage / Sample Code Modal
The Usage / Sample Code window provides ready-to-use examples for connecting the newsletter subscription feature to a public website page.
This section is important when you want to add a newsletter subscription form to a page, connect it securely to the server, or create an admin shortcut to the subscriber list.
Modal Tabs
The Usage / Sample Code modal is divided into three tabs.
| Tab | Description |
|---|---|
| Usage | Explains the main newsletter flow, including the public subscribe page, security token, unsubscribe process, and admin list. |
| Public Page Code | Provides sample HTML code for creating or embedding a public newsletter subscription form. |
| Admin Link Code | Provides sample code or link structure for opening the admin newsletter subscriber list. |
Usage Tab
The Usage tab summarizes how the newsletter feature works.
| Item | Purpose |
|---|---|
| Public Subscribe Page |
Customers can subscribe to the newsletter from
/ShowPage/Newsletter.
|
| Security Token | The sample form loads an anti-forgery token before submitting the request. This helps protect the form from unauthorized or forged submissions. |
| Unsubscribe |
The unsubscribe form posts to
/ShowPage/Newsletter/Unsubscribe.
|
| Admin List | Administrators can review subscription status, open details, and remove or manage subscribers. |
Public Subscribe Page
The public newsletter page is the visitor-facing page where customers can subscribe.
/ShowPage/Newsletter
Use this page when you want to provide a standalone newsletter subscription page. You can link to this page from the website footer, popup, landing page, or contact page.
Example link
<a href="/ShowPage/Newsletter" target="_blank">
Subscribe to Newsletter
</a>
Public Page Code Tab
The Public Page Code tab provides a sample newsletter subscription form. This code can be copied and placed into a page, layout area, popup, or custom HTML section.
The sample form usually includes the following parts:
- A newsletter CSS file reference.
- A subscription form element.
- Hidden security token field.
- Hidden form start time field.
- Honeypot field for spam protection.
- Subscriber input fields such as first name, last name, company, email, and country.
- JavaScript logic for loading the security token and submitting the form.
CSS reference
The sample may include a newsletter stylesheet such as:
<link href="/iboard/skin/common/admin2/css/newsletter/newsletter.css" rel="stylesheet" />
Form structure
The public newsletter form is usually created with an ID such as:
<form id="newsletterSubscribeForm" class="nl-form">
...
</form>
This form is used to collect subscriber information and submit it to the newsletter endpoint.
Security Token
The sample form includes a hidden anti-forgery token field.
<input type="hidden"
id="NewsletterSubscribeToken"
name="__RequestVerificationToken"
value="" />
The token must be loaded before the form is submitted. This protects the newsletter form from forged requests and helps validate that the request was generated by the website.
Do not remove the anti-forgery token field from the sample code unless the server-side newsletter endpoint is intentionally configured to work without token validation.
Form Started Time
The sample form may include a hidden field that records when the form was started.
<input type="hidden"
id="NewsletterFormStartedAt"
name="FormStartedAt"
value="" />
This value can be used to help detect suspicious submissions, such as bots submitting the form too quickly.
Honeypot Field
The sample code may include a hidden or visually hidden honeypot field.
<input type="text"
name="NewsletterFaxNumber"
class="nl-honeypot"
tabindex="-1"
autocomplete="new-password"
aria-hidden="true" />
Real visitors should not fill this field. Automated spam bots may fill it by mistake, which allows the system to detect and reject suspicious submissions.
The honeypot field should remain hidden from normal users and should not be removed from the form.
Subscriber Input Fields
The sample form may include standard subscriber fields.
| Field | Purpose |
|---|---|
| FirstName | Subscriber�s first name. |
| LastName | Subscriber�s last name. |
| CompanyName | Subscriber�s company name. |
| Subscriber�s email address. This is usually required. | |
| Country | Subscriber�s country information. |
Unsubscribe Form
Newsletter unsubscribe requests are posted to:
/ShowPage/Newsletter/Unsubscribe
Use the unsubscribe endpoint when you need to provide a way for subscribers to opt out of future newsletter communication.
Unsubscribe requests should be respected. Avoid manually reactivating unsubscribed users unless permission has been clearly provided.
Admin Link Code Tab
The Admin Link Code tab provides sample link code for opening the newsletter management page from an admin area, dashboard, shortcut, or internal page.
This is useful when you want to create a direct shortcut to the newsletter subscriber list.
Example admin link
<a href="/Admin/Newsletter" target="_blank">
Open Newsletter Subscribers
</a>
Copy Code Button
The Copy Code button copies the currently displayed sample code. Use this button when you want to paste the code into another page or layout area.
- Click Usage / Sample Code.
- Select the required tab.
- Review the displayed sample code.
- Click Copy Code.
- Paste the code into the target page, template, popup, or layout area.
- Test the public newsletter form after saving.
Recommended Integration Workflow
- Open Admin > CRM > Newsletter.
- Click Usage / Sample Code.
- Review the Usage tab to understand the newsletter flow.
- Open the Public Page Code tab.
- Click Copy Code.
- Paste the sample code into the target page or layout area.
- Save the page.
- Open the public page and test a subscription.
- Return to the admin Newsletter page and confirm that the subscriber was created.
Important Implementation Notes
- Do not remove the anti-forgery token unless your endpoint is configured for that behavior.
- Keep the honeypot field in the form to help reduce spam submissions.
- Make sure required fields match the server-side newsletter model.
- Always test the form after copying the sample code into a page.
- Confirm that the newsletter CSS path is valid in your installation.
- Use the unsubscribe endpoint when creating unsubscribe links or unsubscribe forms.