purplemine wrote:How is everyone calling this from a form, for example. I'm hoping to integrate into several different places and looking for some options!
Thanks,
John
Hi John,
integration from a form is not too complex and depends on what you would like to do with the script. If you wish to subscribe a list of emails you can create a textarea form to send to the script and then let the script perform several cURL calls for the subscription of all the users.
However, I have seen the PHPList Class post and I was more interested in the HTTP hack since as somebody said before, calling the database directly is not a good practice in case the schema will change.
I have written a little cURL integration in Joomla. Very simple, I just pass the basic call to the default subscription page if the $_POST or $_GET do not have a specific subscribe, unsubscribe, preference,etc value specified. When one of these specific actions is included in the post or get then i pass it directly to cURL and this to phplist to perform the action.
The problem with this approach is that when i try to run a p=preferences action (when the user wants to change his details). The form in not very well displayed by cURL because somehow PHPList Javascript does not get interpreted and thinks you are somekind of BOT trying to perform some malicious action. This results in showing a form that is totally corrupt and does not allow the preferences modification action.
Example (PLEASE WORK OUT THE URLS - THE FORUM WONT LET YOU INCLUDE THEM UNLESS YOU HAVE POSTED 10 times already):
fully working call to phpList directly without cURL
trippinsupport.dreamhosters DOT com /joomla/mailing/?uid=3d70ad1d761fa64afce5b9910b0372e4&p=preferences
NOT working call from cURL for p=preferences
trippinsupport.dreamhosters DOT com /joomla/mailing.html?uid=3d70ad1d761fa64afce5b9910b0372e4&p=preferences
I have googled and searched for an integration or expansion of cURL to interpret correctly the JavaScript provided on the page but nothing helped so far.
I think if this can be solved the approach above is the best solution to fully integrate phpList in a easy way with an external system.
Any comments or help is very much appreciated.
---
Just to let you know the problem was cause by joomla's plug in Content - Email Cloaking