
terrill
User
Aug 21, 2002, 8:21 PM
Post #1 of 15
(11168 views)
Shortcut
|
|
"Email All Authors" script
|
Can't Post
|
|
UPDATE: WebGuys and I have made TWO updates to the script! PLEASE USE the last one posted! Skip the first updated file WebGuys posted (Todd, could you delete it, please?). The newest version uses Artman User ID's and Passwords before someone can send messages to EVERYONE in your Author list. ----------------------------------------------------------------------------------------- Got something you'd like to send to all of your authors? You know, like what's new in the latest release of Artman you just installed? Got a phone call from Martha Stewart, and you've got a "Hot Stock" tip? The attached script: - Reads your account.dat.cgi data.
- Displays a form with ALL the Authors names checked and ready to send them an email.
- A button for clearing all the checkboxes so you can do it manually for a select group of Authors.
- A button to cancel and go to your home page.
- And, a magic button to send the message, if you'd like!
NOTE: This was written for Unix/Linux servers!!! It MIGHT work on your Windoze server, but you'll have to discuss the following requirements with your Server Admin: Requirements (Unix/Linux or Windoze): - The Perl module Mail::Mailer .
- Sendmail (you could use another mail package. Ask your Admin and a Perl Programmer) .
- Edit your Authors, and add one line containing their email address (see below).
Hey! It Won't Hurt to edit ONE Author (Yourself, maybe?), load the script, and SEE if it works on your server! If it runs, cool. If not: call your Admin... they need work, too. Most Unix/Linux servers should have sendmail (a LOT of other email programs use it under the hood). The question would be, does it have the Perl Module Mail::Mailer? Chances are good that, if you've got an "on-the-ball" hosting service, it's there! Modifications to Artman: In each Authors information, add the line (preferably at the top) in the "Notes" box: mailto:joe@somewhere.com Please note that the word "mailto:" is cAsE SenSItive in my script, and must be lowercase. The email address part, it doesn't matter... feel free to turn the CAPS LOCK KEY ON IF YOU'D LIKE after the colon. Hit enter so it's on a line by itself. That's it for the Artman mods. Next, upload the attached script to your cgi-bin below where your "artman/data" directory is located. Edit the script. There are five lines of code YOU have to edit, for paths, return email address and titles. Save the script, chmod 755, get your handy-dandy browser out, and go send a message! If an Author DOES NOT have an email address in their "Notes" they DON'T appear in the list. It ain't a pretty-looking form, and the script has a work-a-round in it (does more work than it should have to) because my hosting service crippled sendmail. My host only allows one receiver per message to help prevent spamming. So, it takes longer than it should... but hey, it gets the job done! And, it'll work on your host if they've cripple sendmail, too. That's a benefit, actually! I already have other ideas for improvements, like, a multiple selection listbox with Author levels, so you can select by level. Haven't decided if it's that important to me, yet. Might take me a week or two. If you send me $1,000,000 USD in Bearer Bonds, I might consider additional improvements. Oh, a "Subject:" field will only cost ya $100,000... or, you can modify the code your self. You'll learn more if you do it, me thinks. Enjoy! I'm going back and tinker... I see from recent posts, I have more work/fun ahead. -- Terrill -- [quote] "Evaporating expectations of quality: 1980's paradigm: If it's worth implementing once, it's worth implementing twice. 1990's paradigm: Ship the prototype! 2000's paradigm: Ship the idea!" ---Larry Rosler: http://www.perl.com/pub/a/2000/06/rosler.html [/quote]
(This post was edited by terrill on Aug 22, 2002, 12:52 PM)
|