Newsletters API
Newsletters use the pages API to display on templates. There is an API to add a newsletter signup on a site. The members who sign up with added to groups in the CMS.
Newsletter sign up uses the members tag and display:join.
Example:
<?
getContent(
"member",
"display:join",
"group:newsletters",
"capture:names",
"submitimage:/images/submit.jpg",
"show:<label>Newsletter Signup</label>",
"success:/mailing-list/"
);
?>
Parameters
group
Defines the group(s) that the user will be added to. Accepts, the slug of the group name. For multiple groups, separate the names with a comma. See the 'select' parameter to see options for how the user will decide which group to join.
Example:
"group:newsletters,men",
id
If multiple sign up forms are included on a page, id should be used to prevent any conflicts.
"id:signup2",
capture
Right now, only accepts 'names'. This will add additional form elements for first and last name.
"capture:names",select
If multiple groups are defined there are three ways they can be handled.
- If select is omitted, the user will be assigned to all groups
- If 'select:dropdown' is used, the user will be presented with a select dropdown and many select one group.
- If 'select:checkboxes' is used, the user will be presented with checkboxes and may select as many groups as they would like.
"select:checkboxes",submitimage
The image that will be used for the submit button.
"submitimage:/images/submit.jpg",
submitvalue
The text that will be shown on the submit button. submitimage will override this.
"submitvalue:Subscribe",
example
Changes the default text in the text box.
"example:name@example.com",
success
The page the the user will be taken to after entering a valid email address.
"success:/thank-you/",
show
There are no tags for show, but any text entered in will be displayed directly before the form.
"show:<label>Newsletter Signup</label>",