Subscription Cookbook


How to Subscribe an Email Address to a Mailing List

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)

Command Line Utility - subscribe_email.pl

Find a copy of subscribe_email.pl in the Dada Mail distro at:

dada/extras/scripts/subscribe/subscribe_email.pl

Arguments

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.

Web Services

SOAP

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

REST

A rest server and example client are bundled with the Dada Mail distro. You can find them at:

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:

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.


Other examples

FormMail Integration

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

TFmail Integration

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