By default AcySMSwill 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 another website or on your facebook page, then you will need an external subscription form.

 

iframe integration

If your other website enables you to include an iframe, the easiest way to embed your subscription form on that other website is to use this method:

Create an AcySMS subscription module on your own website and configure it the way you want (with captcha, extra fields, terms and conditions...)
Copy the ID of that module and then on your other website, create an iframe to display this module:

Show/Hide html5 code

View source
<iframe src="http://www.YOURWEBSITE.COM/index.php?option=com_acysms&ctrl=sub&task=display&tmpl=component&formid=YOUR_MODULE_ID" height="YOUR_HEIGHT" frameborder="0" width="100%" ></iframe>

Please make sure to replace your website url, your module id and the iframe height with the right values.

We recommend you to set the module redirection to "ajax".

With this system you can integrate your Newsletter subscription module to your Facebook page, so that all your fans can subscribe to your newsletter directly from Facebook. Click here to see our tutorial about How to add a sign up form to your Facebook page.

Default subscription form

The standard code is:

Show/Hide html5 code

View source
 
 
<form action="http://YOURWEBSITE/index.php?option=com_acysms&ctrl=sub" method="post">
 
   <table class="acysms_form">
      <tr>
         <td><label for="user_firstname">First Name</label></td>
         <td><input id="user_firstname" type="text" name="user[user_firstname]" value=""/></td>
      </tr>
 
      <tr>
         <td><label for="user_lastname">Last Name</label></td>
         <td><input id="user_lastname" type="text" name="user[user_lastname]" value=""/></td>
      </tr>
      <tr>
         <td><label for="user_phone_number">Phone Number</label></td>
         <td>
            <input id="user_phone_number" type="text" name="user[user_phone_number][phone_num]" value=""/>
            <input type="hidden" name="user[user_phone_number][phone_country]" value="PHONE_PREFIX">
         </td>
 
 
      </tr>
      <tr>
         <td colspan="2"><input class="button" type="submit" value="Subscribe" name="Submit"/></td>
      </tr>
   </table>
 
   <input type="hidden" name="acyformname" value="formAcysms1"/>
   <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_acysms"/>
   <input type="hidden" name="visiblegroups" value=""/>
   <input type="hidden" name="hiddengroups" value="YOUR_GROUPS"/>
</form>
 
 

Don't forget to:

  • Replace YOURWEBSITE by the url of your own website!
  • YOUR_REDIRECT_URL by the url of your redirect url
  • YOUR_GROUPS by your groups IDs separated by comma.
  • YOUR_PHONE_PREFIX by the country prefix by default ("+33" for example)
    For example if you want the user to be subscribed to your group ID 3 and ID 4 then you should specify 3,4

 

 

Add custom fields to your form

If you created some custom fields, you can also add them to your external subscription form.

Each field should be added using the code:

Show/Hide html5 code

View source
<input name="user[YOUR_CUSTOM_FIELD_COLUMN_NAME]" />

In AcySMS you can also edit your custom field and directly copy/paste the html code to include it in your external subscription form.

 

Display your lists on the form

If you want the user to select the lists he should be subscribed to, you can display them on your form with that code.
Please make sure the IDs of these lists are not in the hiddenlists parameter.

Show/Hide html5 code

View source
<input type="checkbox" name="subscription[]" value="3"/>My group ID 3<br/>
<input type="checkbox" name="subscription[]" value="7"/>My group ID 7<br/>
<input type="checkbox" name="subscription[]" value="14"/>My group  ID 14<br/>
 

Add a "terms and conditions" checkbox

You can add a "terms and conditions" checkbox using this code:

Show/Hide html5 code

View source
<form action="http://YOURWEBSITE/index.php?option=com_acysms&ctrl=sub" method="post">
 
<table class="acysms_form">
   <tr>
      <td><label for="user_firstname">First Name</label></td>
      <td><input id="user_firstname" type="text" name="user[user_firstname]" value=""/></td>
   </tr>
 
   <tr>
      <td><label for="user_lastname">Last Name</label></td>
      <td><input id="user_lastname" type="text" name="user[user_lastname]" value=""/></td>
   </tr>
   <tr>
      <td><label for="user_phone_number">Phone Number</label></td>
      <td><input id="user_phone_number" type="text" name="user[user_phone_number][phone_num]" value=""/>
         <input type="hidden" name="user[user_phone_number][phone_country]" value="PHONE_PREFIX"></td>
   </tr>
   </tr>
   <td colspan="2" ><input type="checkbox" value="1" name="terms" /><a href="linktoyourterms">Terms and conditions</a></td>
   </tr>
   <tr>
      <td colspan="2"><input class="button" type="submit" value="Subscribe" name="Submit"/></td>
   </tr>
</table>
 
<input type="hidden" name="acyformname" value="formAcysms1"/>
<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_acysms"/>
<input type="hidden" name="visiblegroups" value=""/>
<input type="hidden" name="hiddengroups" value="YOUR_GROUPS"/>
</form>
 

Follow us :