On May 15, 2008, at 7:24 PM, Moshe Katz wrote:
right now, I have a php script that just pipes its output to send_dada_mail.pl.
I just wanted to know if there is a more elegant way to do it.
That's a pretty good question and I have been working on something. Here's a draft of some ideas. It doesn't currently work with the released beta (sometimes, when writing documentation, you come across bugs, which you fix, while writing the documentation!) , but it will work in the next release:
Accessing the, ``Send a List Message'' API
If the send_dada_mail.pl script isn't up your alley, you can make a very small utility script that'll bridge between your app - whatever language it's written in and Dada Mail. Here's what such an app may look like:
#!/usr/bin/perl
# Change! The perllibs below to point to Dada Mail's perl libraries:
use lib qw(
./DADA
./DADA/perllib
/home/myaccount/cgi-bin/dada
/home/myaccount/cgi-bin/dada/DADA/perllib
);
use CGI;
my $q = new CGI;
my $list = $q->param('list');
$q->delete('list');
if($q->param('process')) {
use DADA::App::MassSend;
my $ms = DADA::App::MassSend->new;
$ms->send_email(
{
-cgi_obj => $q,
-list => $list,
-html_output => 0,
}
);
print $q->header();
print "sending is on its way!";
}
else {
print $q->header() ;
print "I don't know what you want me to do!";
}
The above example is an incredibly bare-bones idea on how to send a list message using the DADA::App::MassSend API. Unfortunetly, the API isn't super flexible, but it can do a whole lot, if you need it to.
Save the above script as something like, send_list_message.cgi (or whatever you'd personally like). Put it into your cgi-bin/dada directory (to start) and change it's permission to, 755
The next thing you'll want to do is create an HTML page with a form that, when submitted will have the correct information to send a list message. Here's a very small example:
<form action="http://example.com/cgi-bin/dada/send_list_message.cgi"; method="post">
<input type="hidden" name="process" value="1" />
<input type="hidden" name="list" value="mylist" />
<p>Subject: <input type="text" name="Subject" value="" /> </p>
<p>PlainText Version: <br />
<textarea name="text_message_body"></textarea>
</p>
<p>HTML Version: <br />
<textarea name="html_message_body"></textarea>
</p>
<p>
<input type="submit" />
</p>
</form>
Breaking this down:
the form field itself
You'll have to tweak the, action paramater to point to the script we just made.
process
Set this form field value to, 1
list
Set this to a valid list shortname
Subject
The Subject of your message.
text_message_body
The PlainText version of your message (if any)
html_message_body
The HTML version of your message (if any)
Make sure to customize the form's, action to correspond to where you're currently keeping this script and also the form field, ``list'' to be a valid listshortname of yours.
The form fields, Subject, text_message_body and html_message_body are named the same as the form fields located on the, Send a List Message screen. Most every form field that's located in that form can be added to our example, including file attachments, partial sending options, archiving options, etc.
Our little example above only shows how to create a form that basically cicrumvents Dada Mail's own security. If you do use this form, make sure some semblance of security is put back into your script.
Hopefully, if you're a seasoned Perl programmer, you can edit the above idea to work more closely within your own Perl program. You don't need to explicitly post to the script - all you have to do is fill out the CGI object params, like so:
$q->param('list', 'mylist');
$q->param('process', 1);
$q->param('Subject', 'My Subject');
$q->param('text_message_body', "This is my PlainText version!");
# etc....
use DADA::App::MassSend;
my $ms = DADA::App::MassSend->new;
$ms->send_email(
{
-cgi_obj => $q,
-list => $q->param('list'),
-html_output => 0,
}
);
What if you're using another language, like php?
My advice, currently, is to call the outside script using something like php's curl support:
http://us.php.net/curl
The idea is the same, but instead of creating an HTML form you manually submit, you pass the variables needed to the curl session and post them to the outside script.
[/snip]
The main idea to this is, any form field that's in the Send a List Message screen is something you can hand over to this little script, and it should work exactly the same.
This is quite different from the send_dada_email.pl script, which wants a fully formatted email message, headers and all, which can be a quite another step before you can send Dada Mail the message.
--
Justin J.
Dada Mail - Write Once: Distribute Everywhere Software
url: http://mojo.skazat.com
Seen Dada Mail 3?
http://mojo.skazat.com/features/3_0/
On May 15, 2008, at 7:24 PM, Moshe Katz wrote:
right now, I have a php script that just pipes its output to send_dada_mail.pl.
I just wanted to know if there is a more elegant way to do it.
- Moshe
On Fri, May 16, 2008 at 4:22 AM, Dada Mail (Justin J) <dada@PROTECTED> wrote:
On May 15, 2008, at 7:18 PM, Moshe Katz wrote:
Can you put something in the book about plugging in to send a message from my own interface?
That's something I'd just have freely available. How do you currently want to do it? I'll try to walk you through here, and if it works, add it to the docs.
Cheers,
--
Justin J.
Dada Mail - Write Once: Distribute Everywhere Software
url: http://mojo.skazat.com
Seen Dada Mail 3?
http://mojo.skazat.com/features/3_0/
On May 15, 2008, at 7:18 PM, Moshe Katz wrote:
Can you put something in the book about plugging in to send a message from my own interface?
On Fri, May 16, 2008 at 3:40 AM, Dada Mail <dada@PROTECTED> wrote:
I'm currently seeing the light of a gigantic release cycle (for me, anyways), that'll, at the end of it all, see Dada Mail 3.0 released and labeled as, "Stable".
One of my biggest hopes for this release is to have a great set of documentation to go along with it. Right now, I hope to have more technical documentation on the support site - and for free; things like the API docs, the FAQ's and configuration and installation instructions for Dada Mail itself and all of the plugins and extensions.
I'm also thinking of having some screen casts on more general topics like, "How to Install", "How to Send a List Message" for people to get a feel on how the program works, without having to install it themselves.
I'm also currently writing a brand new copy of the Magicbook. I'm shooting to have a chapter for every single List Control Panel Screen, as well as chapters that encompass larger topics, like the Sending Monitor - which is very powerful, but needs a bit of explanation, so you know what everything does.
I'm also going to have the Magicbook available online, with copies of Dada Mail having a link to the specific screen's (at least in the List Control Panel) docs, just a click away. You'll need a subscription of Pro Dada to access these docs and logging in will just need a username/password combo. I may even change the subscription length from a year to, "the life of the program".
My hope is to lift as many restrictions from the free version as possible and have people find the most value in the docs that hopefully, should cover almost everything. I'm def. shipping the 3.0 stable version with ALL plugins and extensions available, with the required docs to install and configure them.
So, this is a request for topics to be covered under the Magicbook, or the general documentation. If there are some topics already written that you think needs clarification, please - let me know.
Writing these docs has been taking a whole lot of time, but I'm hoping it'll be worth it :)
--
Justin J.
Dada Mail - Write Once: Distribute Everywhere Software
url: http://mojo.skazat.com
Seen Dada Mail 3?
http://mojo.skazat.com/features/3_0/
--
Post: <mailto:dadadev@PROTECTED>
Unsubscribe:
<http://mojo.skazat.com/cgi-bin/dada/mail.cgi/u/dadadev/>
List Information: <http://mojo.skazat.com/cgi-bin/dada/mail.cgi/list/dadadev>
Archive: <http://mojo.skazat.com/cgi-bin/dada/mail.cgi/archive/dadadev>
--
------------------------------
Moshe Katz
KatzNet Computers
-- moshe@PROTECTED
-- kohenkatz@PROTECTED
-- moshe@PROTECTED
-- kohenkatz@PROTECTED
-- moshekatz@PROTECTED
-- kohenkatz@PROTECTED
-- +1(301)TO-REPEA(T)
-- +1(301)867-3732
--
------------------------------
Moshe Katz
KatzNet Computers
-- moshe@PROTECTED
-- kohenkatz@PROTECTED
-- moshe@PROTECTED
-- kohenkatz@PROTECTED
-- moshekatz@PROTECTED
-- kohenkatz@PROTECTED
-- +1(301)TO-REPEA(T)
-- +1(301)867-3732
--
Post: <mailto:dadadev@PROTECTED>
Unsubscribe:
<http://mojo.skazat.com/cgi-bin/dada/mail.cgi/u/dadadev/>
List Information: <http://mojo.skazat.com/cgi-bin/dada/mail.cgi/list/dadadev>
Archive: <http://mojo.skazat.com/cgi-bin/dada/mail.cgi/archive/dadadev>
Post:
mailto:dadadev@PROTECTED
Unsubscribe:
http://mojo.skazat.com/cgi-bin/dada/mail.cgi/u/[list]/
List Information:
[program_url]/list/[list]
Archive:
[program_url]/archive/[list]
Start a new thread, email: dadadev@dadamailproject.com
This is the developer discussion mailing list for Dada Mail.
If you are just looking for support Dada Mail, consult the message boards at:
https://forum.dadamailproject.com
Documentation for Dada Mail:
Specifically, see the Error FAQ:
https://dadamailproject.com/d/FAQ-errors.pod.html
To post to this list, send a message to:
mailto:dadadev@dadamailproject.com
All subscribers of this list may post to the list itself.
Topics that are welcome:
Dada Mail is on Github:
https://github.com/justingit/dada-mail/
If you would like to fork, branch, send over PRs, open up issues, etc.
This Privacy Policy is for this mailing list, and this mailing list only.
Email addresses collection through this mailing list are used explicitly to work within this email discussion list.
We only collect email addresses through our Closed-Loop Opt-In system.
We don't use your email address for any other purpose.
We won't be sharing your email address with any other entity.
Unsubscription can be done at any time. Please contact us at: justin@dadamailproject.com for any help regarding your subscription, including removal from the mailing list.
All mailing list messages sent from us will include a subscription removal link, which will allow you to remove yourself from this mailing list automatically, and permanently.
All consent to use your email address for any other purpose stated at the time of the mailing list subscription will also be revoked upon mailing list removal.