AcyMailing
Latest version
Search
K
Links

Other subscription methods

See all other subscriptions methods for AcyMailing
The easiest way to let users subscribe to your newsletters is to activate the default AcyMailing subscription form (WP Widget or Joomla module), but in some cases you may need other solutions.
Link in an email
Subscription via URL
External subscription form
You can easily insert a direct subscribe link in your emails with the dynamic text feature. First, insert a text zone then click in it:
On the right of the editor, the dynamic text selection zone appears. Under the tab "Subscription", click the "Insert a subscribe link in your email" option, select the lists you want the user to be subscribed to when clicking the link, then click the "Insert dynamic text" button.
You can modify the text of the link with the "Text" option, "Subscribe" is written by default.

Subscription via URL

First of all, make sure to allow non logged-in users to subscribe in the configuration page, tab "Subscription", option "Allow user data modifications without identification"
If you want to use a direct subscription link somewhere on your site, or even another site, you can use this link:
Joomla websites
https://www.example.com/index.php?option=com_acym&ctrl=frontusers&task=subscribe&hiddenlists=1,3&user[email][email protected]
WordPress websites
https://www.example.com/index.php?page=acymailing_front&ctrl=frontusers&task=subscribe&hiddenlists=1,3&user[email]=em[email protected]&action=acymailing_frontrouter&noheader=1
In these links, you have to replace "1,3" by the IDs of the lists (you can see them on the AcyMailing contact lists' listing page on the right). [email protected] has to be replaced by the email address of the user.
For new users, you can add "&user[confirmed]=1" to make sure they're created as confirmed, if this is what you want to do.

Redirection after subscription

You can add a "redirect" parameter to your link so that AcyMailing will subscribe the user and then redirect the user to the specified url. Example : &redirect=http%3A%2F%2Fwww.google.com All submitted data should be in utf-8 and url-encoded (using the php function urlencode() for example).
  • = should be replaced by %3D
  • & should be replaced by %26
  • ? should be replaced by %3F
  • / should be replaced by %2F
  • : should be replaced by %3A

External subscription form

Sometimes you need to create a form on another website. If this is your case, you can use the following code:

Joomla websites

<form action="https://EXAMPLE/index.php" 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 colspan="2"><input class="button" type="submit" value="Subscribe" name="Submit" /></td>
</tr>
</table>
<input type="hidden" name="ctrl" value="frontusers" />
<input type="hidden" name="task" value="subscribe" />
<input type="hidden" name="redirect" value="https://YOUR_REDIRECT_URL" />
<input type="hidden" name="hiddenlists" value="YOUR_LISTS" />
<input type="hidden" name="option" value="com_acym" />
</form>

WordPress websites

<form action="https://EXAMPLE/index.php" 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 colspan="2"><input class="button" type="submit" value="Subscribe" name="Submit" /></td>
</tr>
</table>
<input type="hidden" name="ctrl" value="frontusers" />
<input type="hidden" name="task" value="subscribe" />
<input type="hidden" name="redirect" value="https://YOUR_REDIRECT_URL" />
<input type="hidden" name="hiddenlists" value="YOUR_LISTS" />
<input type="hidden" name="page" value="acymailing_front" />
<input type="hidden" name="action" value="acymailing_frontrouter" />
<input type="hidden" name="noheader" value="1" />
</form>
In both cases, don't forget to replace the following strings:
  • EXAMPLE: by the website on which AcyMailing is installed, it will collect the form's data
  • YOUR_LISTS: by the IDs of the lists separated by a coma. The user won't see these lists.
  • YOUR_REDIRECT_URL: this input is actually optional, you can specify any URL here

Add custom fields

Custom fields can also be added in the form. You need to get the ID of the field from the custom fields listing (or in the database column "id" of table "xxx_acym_field"). Then use it to replace id in customField[id]:
<tr>
<td><label for="user_field">My field</label></td>
<td><input id="user_field" type="text" name="customField[id]" value="" /></td>
</tr>

Display the lists

You can let the users choose their lists by adding inputs like this:
<input type="checkbox" name="subscription[]" value="3"/>My List with ID 3<br/>
<input type="checkbox" name="subscription[]" value="7"/>My List with ID 7<br/>
<input type="checkbox" name="subscription[]" value="14"/>My List with ID 14<br/>

The captcha blocks the form

If you activated the captcha in the AcyMailing configuration page, tab "Security", you will need to add the following input in your form with the "Security key" value of the same page:
<input type="hidden" name="seckey" value="SECURITY_KEY_VALUE" />
Adding this input won't add an invisible recaptcha, it's just a security to prevent anyone from creating an external form redirecting to your website.