Subscription via URL
Description
The AcyMailing subscription via URL enables you to integrate AcyMailing with other components such as Fabrik, ChronoForms, RSForm!Pro and other form components.
Subscription via URL
You have to redirect the user to this url:
index.php?option=com_acymailing&ctrl=sub&task=optin&hiddenlists=YOUR_LISTS_ID&user[email]=YOUR_EMAIL
YOUR_LISTS_ID should be replaced by the AcyMailing lists ID you want the user to be subscribed to. If you want to subscribe the user to only one list, simply add the ID of this list in your url. Example (2 is the ID of the list) : index.php?option=com_acymailing&ctrl=sub&task=optin&hiddenlists=2&user[email]=This email address is being protected from spambots. You need JavaScript enabled to view it. If you want the user to be subscribed to several lists, separate each lists with a comma. Example (I want the user to be subscribed to lists ID 3 and 6) : index.php?option=com_acymailing&ctrl=sub&task=optin&hiddenlists=3,6&user[email]=This email address is being protected from spambots. You need JavaScript enabled to view it.
YOUR_EMAIL should be replaced by the e-mail of the subscriber.
You can add other parameters in the url which are optional:
user[name] : this parameter enables you to add the name of the user. Example : index.php?option=com_acymailing&ctrl=sub&task=optin&hiddenlists=1,2,3&user[email]=This email address is being protected from spambots. You need JavaScript enabled to view it.&user[name]=John
user[html] : this parameter enables you to set the receive html option of the user. If you don't add this parameter, the user will be added as "receive html : Yes". The options are 1 (to receive HTML e-mails) or 0 (to receive plain text e-mails) Example : index.php?option=com_acymailing&ctrl=sub&task=optin&hiddenlists=1,2,3&user[email]=This email address is being protected from spambots. You need JavaScript enabled to view it.&user[html]=0
user[columnName] : Using AcyMailing Enterprise, you can add extra fields to your subscriber profile. You can also use these extra fields in the subscription via url by adding the parameter user[YOUR_COLUMN_NAME]=Your Value. Example : If I added an extra field with the column name "phone", I can use the subscription url: index.php?option=com_acymailing&ctrl=sub&task=optin&hiddenlists=1,2,3&user[email]=This email address is being protected from spambots. You need JavaScript enabled to view it.&user[phone]=879869876
redirect : this parameter enables you to add a redirect url so that AcyMailing will subscribe the user and then redirect the user to the specified url. Example : index.php?option=com_acymailing&ctrl=sub&task=optin&hiddenlists=1,2,3&user[email]=This email address is being protected from spambots. You need JavaScript enabled to view it.&redirect=http%3A%2F%2Fwww.google.com It seems that the "view" argument in the redirect url does not work and should be replaced by "task": index.php?option=com_content&view=article&id=34 does not work and should be replaced by index.php?option=com_content&task=article&id=34 (don't forget to encode your url first) so your redirect url will be: http://www.yourwebsite.com%2Findex.php%3Foption%3Dcom_content%26task%3Darticle%26id%3D34
seckey : If you enabled the captcha on your forms, you should add your security key to this url by adding an extra argument at the end of the url: seckey=YOUR_KEY (YOUR_KEY should be replaced by the key you can see on your AcyMailing configuration page, tab "security) Example: index.php?option=com_acymailing&ctrl=sub&task=optin&hiddenlists=1,2,3&user[email]=This email address is being protected from spambots. You need JavaScript enabled to view it.&seckey=Hlkfj897sqiduh7805
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
Test the subscription via URL
Before integrating the subscription via URL in your form component, please make sure you tested it independently and you obtained the expected result.
Step 1: Get your lists ID
Go on the Lists management page on the AcyMailing back-end.
On this listing you will see all your lists and you will be able to pick up the list ID. (in red in the following screenshot)
Lists IDs
We will create a URL to subscribe the user to lists ID 18 and 20 (Newsletters and Possible Affiliate).
Step 2: Build your url
Open a new window/tab on your browser and enter the url :
http://www.yourwebsite.com/index.php?option=com_acymailing&ctrl=sub&task=optin&hiddenlists=18,20&user[email]=yourname@example.com&user[name]=yourname
Please make sure to replace www.yourwebsite.com by your own url.
In our example we will subscribe the user to lists 18 and 20, that's why we added the argument hiddenlists=18,20.
After making sure the user has been properly subscribed to the lists (see step 3) , you can add a redirect link to this url and test again :
http://www.yourwebsite.com/index.php?option=com_acymailing&ctrl=sub&task=optin&hiddenlists=18,20&user[email]=yourname@example.com&user[name]=yourname&redirect=http://www.google.com
Test
If you use a SEF component (other than the default Joomla one), your url may be altered and the subscription won't work... The easiest way to fix that is to exclude AcyMailing urls from your SEF component.
Step 3: Check the subscription from the back-end
Go to your AcyMailing user management screen on the back-end. You should see a new user added and this user should be subscribed to the lists 18 and 20.
If it's not the case, please make sure your lists are published with a correct access level and test again without redirect url.
Use the subscription via URL in your Newsletters
You can use the subscription via url in a Newsletter or any other e-mail to ask your user to subscribe to another list.
Create a link in your Newsletter and specify the url:
index.php?option=com_acymailing&ctrl=sub&task=optin&hiddenlists=YOUR_LIST_ID&user[email]={subtag:email|urlencode}
Please don't forget to replace YOUR_LIST_ID by the ID of your list.
As the tag {subtag:email} will be automatically replaced by the receiver e-mail during the send process, each user will receive his own subscription link.
To unsubscribe the user from a list, you should use this url:
index.php?option=com_acymailing&ctrl=sub&task=optout&hiddenlists=YOUR_LIST_ID&user[email]={subtag:email|urlencode}
Last updated