[pmwiki-users] ZAPnews working...
editor at fast.st
Sun Nov 5 05:49:50 CST 2006
I'm very excited to be able to announce a new ZAP news module that
seems to be working on my machine. I hope to release it later today
to the PmWiki cookbook as soon as I can write up the docs, but wanted
to get some last minute input on:
1) The design specs (offer suggestions, recommend changes)
2) The easiest way to run it (any bright ideas?)
* The ZAPmail module plugs into ZAP seamlessly. Just download the
small module, drop it in your cookbook, and enable in config file.
* Mailing list management is actually done through ZAP which has a
simple logging feature, enabling you to create simple lists, sort
them, remove duplicates, delete entries, add items, etc., very easily.
This feature also has many other features, but it works great for
maillist management. You can also manually cut and paste email lists
right into the wiki page.
* ZAPmail allows you to create a newsletter form specifying $batch
(number of emails sent at a time), and $throttle (minimum seconds
between sendings). You specify sender, maillist, subject, and
message, or allow form submitter to.
* Messages are fully templated, and has the standard ZAP markup for
inserting form fields, and the email currently being sent into the
* When a zapnews form is submitted, a wiki page is created and stored
in group Temp-Maillist with all the required parameters, including the
entire list, and message. It does not send the newsletter at this
point. This group is the newsletter "queue", and each page name is
based on a timestamp--indicating when it is ready to be processed
* A simple (:zapnews:) markup can be inserted into any page, which
will check to see if there are any queued newsletters waiting to be
processed. If there are, it will send the designated number of
emails, delete those emails from its internal list, rename itself to a
new timestamp (based on throttling) and then exit. After the last
batch, it deletes the queue page completely.
* When processing a batch of emails, the zapnews directive also
creates a LOG page in the same group identifying the Subject: and
Sent: (can use as text vars in a pagelist) and generates a domain
stripped list of each email sent. When the last newsletter is sent,
it adds "Sending Complete!" to the bottom (could be used to list all
sent newsletters). You can check these logs right in PmWiki at any
* A simple locking mechanism is used when one user begins the
newsletter submission process to prevent a second, duplicate
processing of each batch.
Any additional features? questions? concerns? It is working really
slick for me right at the moment.
HOW TO RUN IT
Because I never was able to get the script to run in the background, I
ended up doing it as a directive that runs in a PmWiki page. It does
however tie up loading of a page, so you can't trigger it by putting
the directive on your home page, login page, etc. There are several
possibilities however, and I'm open to suggestions from others on how
best to do this:
* Use Cron to target a PmWiki page with the directive on it every so
often to run your newsletters.
* Put the directive in a a hidden frame of your site (haven't tested),
hoping the main page will load while the invisible frame putters
around sending it's emails for awhile. Or even in an iframe in a
hidden frame--so it could be triggered "onload".
* Create a page that auto refreshes itself every so often and leave it
running on your computer (assuming you have always on internet).
* Or similarly find some kind of ping (?) program that automatically
calls a page on the internet from your computer every so often from
your home machine. Again, you would have to have an always on
* Some other suggestion one of the bright minds on PmWiki offers. : )
Anyway, I'm quite excited. Thanks to everyone for their help.
More information about the pmwiki-users