External subscription formBy default AcyMailing will install a subscription module so you can simply publish it and configure it to get a subscription form on your website. But if you want to add a subscription form on an other website or on your facebook page, then you will need an external subscription form.
Default subscription formThe standard code is: <form action="http://YOURWEBSITE/index.php?option=com_acymailing&ctrl=sub" method="post">
<table class="acymailing_form">
<tr>
<td><label for="user_name">Name</label></td>
<td><input id="user_name" type="text" name="user[name]" value="" /></td>
</tr>
<tr>
<td><label for="user_email">E-mail</label></td>
<td><input id="user_email" type="text" name="user[email]" value="" /></td>
</tr>
<tr>
<td><label for="user_html">Receive</label></td>
<td><input type="radio" name="user[html]" value="0" id="user_html_0" ><label for="user_html_0">Text</label><input type="radio" name="user[html]" value="1" id="user_html_1" checked="checked"><label for="user_html_1">HTML</label></td>
</tr>
<tr>
<td colspan="2" ><input class="button" type="submit" value="Subscribe" name="Submit" /></td>
</tr>
</table>
<input type="hidden" name="acyformname" value="formAcymailing1" />
<input type="hidden" name="ctrl" value="sub"/>
<input type="hidden" name="task" value="optin"/>
<input type="hidden" name="redirect" value="http://YOUR_REDIRECT_URL"/>
<input type="hidden" name="option" value="com_acymailing"/>
<input type="hidden" name="visiblelists" value=""/>
<input type="hidden" name="hiddenlists" value="YOUR_LISTS"/>
</form>Don't forget to:
Add a captcha to your formIf you use one of our commercial versions, you can turn ON the captcha feature on the AcyMailing configuration page and then add a captcha to your subscription form: Again, don't forget to replace YOURWEBSITE by the url of your own website. So the whole subscription form code will be: <form action="http://YOURWEBSITE/index.php?option=com_acymailing&ctrl=sub" method="post">
<table class="acymailing_form">
<tr>
<td><label for="user_name">Name</label></td>
<td><input id="user_name" type="text" name="user[name]" value="" /></td>
</tr>
<tr>
<td><label for="user_email">E-mail</label></td>
<td><input id="user_email" type="text" name="user[email]" value="" /></td>
</tr>
<tr>
<td><label for="user_html">Receive</label></td>
<td><input type="radio" name="user[html]" value="0" id="user_html_0" >
<label for="user_html_0">Text</label>
<input type="radio" name="user[html]" value="1" id="user_html_1" checked="checked">
<label for="user_html_1">HTML</label></td>
</tr>
<tr>
<td><img class="captchaimagemodule" src="http://YOURWEBSITE/index.php?option=com_acymailing&ctrl=captcha&acyformname=formAcymailing1&val=5753" alt="captcha" /> </td>
<td> <input id="user_captcha_formAcymailing1" class="inputbox captchafield" type="text" name="acycaptcha" size="5" /> </td>
</tr>
<tr>
<td colspan="2" ><input class="button" type="submit" value="Subscribe" name="Submit" /></td>
</tr>
</table>
<input type="hidden" name="acyformname" value="formAcymailing1" />
<input type="hidden" name="ctrl" value="sub"/>
<input type="hidden" name="task" value="optin"/>
<input type="hidden" name="redirect" value="http://YOUR_REDIRECT_URL"/>
<input type="hidden" name="option" value="com_acymailing"/>
<input type="hidden" name="visiblelists" value=""/>
<input type="hidden" name="hiddenlists" value="YOUR_LISTS"/>
</form>
Add custom fields to your formIf you use AcyMailing Enterprise and created some custom fields, you can also add them to your external subscription form. Each field should be added using the code: Since AcyMailing 3.6.0, you can edit your custom field and directly copy/paste the html code to include it in your external subscription form.
Display your lists on the formIf you want the user to select the lists he should be subscribed to, you can display them on your form with that code.
Last Updated on Monday, 12 March 2012 17:52
|




