A challenge people face is trying to tie Dada Mail's subscription system with another system, like a checkout part of a shopping cart, boards/forum, blog or CMS software.
Dada Mail has hooks into its subscribe system, that you can use by making a small perl script, that can be called from your main program. (If you app is written in Perl, an outside program may not be something you'll need to make)
Find a copy of subscribe_email.pl
in the Dada Mail distro at:
dada/extras/scripts/subscribe/subscribe_email.pl
Run subscribe_email.pl
as a shell script, like this:
prompt>perl ./subscribe_email.pl --list mylist --email user@example.com
--list
should hold the listshortname of the list you want to subscribe to.
--email
should hold the email address you want to subscribe.
--verbose
is optional. If set to, 1
, you will get a small report on the request.
You can also pass Profile Fields for the subscriber, just use the, -fields
paramater:
prompt>perl ./subscribe_email.pl --list mylist --email user@example.com ---fields first_name=John --fields last_name=Doe
subscribe_email.pl
can also be called from within another script using something like Perl's, exec
function.
A proof of concept SOAP server and clients (one client written in Perl, one in php) are bundled with Dada Mail. More information:
http://dadamailproject.com/d/README_SOAP.pod.html
for more inspiration
A rest server and example client are bundled with the Dada Mail distro. You can find them at:
dada/extras/scripts/subscribe/subscribe_rest_server.cgi
dada/extras/scripts/subscribe/subscribe_rest_client.cgi
Both are written in perl (although you may write your client in whatever you may like)
The example client will need the following CPAN modules:
The REST server will need the folling CPAN modules:
The example client (subscribe_rest_client.cgi
) needs a few variables filled out:
This will be the URL of the subscribe_rest_server.cgi
Should hold the email address you want to subscribe.
Should hold the listshortname of the list you want to subscribe to.
(hashref) Should hold any Profile Fields you want for the addressee.
Use the subscribe_rest_client.cgi
script as inspiration for integration in your own perl/php program it, by itself, is not a complete script.
See the sourcecode to FormMail to see how we integrated Dada Mail subscription capabilities in this simple form handler:
http://dadamailproject.com/d/Dada-ized_FormMail_README.pod.html
See the sourcecode to TFmail to see how we integrated Dada Mail subscription capabilities in this simple form handler:
http://dadamailproject.com/d/Dada-ized_TFMail_README.pod.html