Creating a standalone newsletter subscription form
You may want to provide a standalone form that allows your users to subscribe to a CiviCRM mailing group rather than providing a URL as in the previous recipe.
How to do it…
It's easy to set up a bit of HTML code that can be pasted into your CMS. In this example we will use Drupal. All you need to know are your group IDs.
Navigate to Contacts | Manage Groups and make a note of any group ID that you wish to use. The groups must be configured for use as mailing lists.
Open up a text editor, create a text file, and enter the following code:
<form action="http://book.dev/civicrm/mailing/subscribe" method="post"> <p>Email: <input name="email" type="text" id="email" /></p> <table> <tr> <td><input name="groupID1" type="checkbox" value="1" /></td> <td>Advisory Board</td></tr> <tr><td><input name="groupID2" type="checkbox" value="1" /></td><td>Newsletter...