1.1.1. Managing contacts from another domain

You can add and remove contacts through simple HTML forms from non-Moski2 sites easily. Just create an HTML form and POST the following fields:

Table 6. Form fields for adding a contact remotely

Field nameDescriptionRequired
email

The email address of the contact

Yes
contact

The name of the contact

No
groups

ID number or developer key for the groups you wish to place the contact in. This can be a comma separated list of several IDs and/or keys.

Yes (not required when removing a contact)
return_url

The address you wish to redirect the visitor to after completing the sign-up.

Yes

Here is an example of adding a contact to contact groups #148 and #149:

<form action="http://<YOUR_MOSKI2_SITE>/m2c/contacts/add" method="post">
  <input type="hidden" name="return_url" value="http://<YOUR_NON_MOSKI2_SITE>/thankyou.html" />
  <input type="hidden" name="groups" value="148,149" />
  <input type="text" name="email" />
  <input type="submit" value="Subscribe" />
</form>

The <YOUR_MOSKI2_SITE> and <YOUR_NON_MOSKI2_SITE> placeholders must of course be replaced with the corresponding Web addresses, and the thankyou.html is simply an example of a page where you can add your own confirmation page - when the contact is added, the visitor will be redirected to the return_url.

Creating a form for removing a contact is similarly simple:

<form action="http://<YOUR_MOSKI2_SITE>/m2c/contacts/remove" method="post">
  <input type="hidden" name="return_url" value="http://<YOUR_NON_MOSKI2_SITE>/thankyou.html" />
  <input type="text" name="email" />
  <input type="submit" value="Unsubscribe" />
</form>

Important

Ask your web developer to unlock your Moski2-site for remote contact management, or none of the above will work.