Firefox PHP

Module: Admin Mass Email

Posted by Joe Curia 
All files from this thread

File Name File Size   Posted by Date  
screenshot.JPG 66.1 KB open | download Joe Curia 09/24/2008 Read message
screenshot2.JPG 28.6 KB open | download Joe Curia 09/24/2008 Read message
admin_mass_email_v5_2_1_06.zip 33.9 KB open | download Joe Curia 10/12/2009 Read message
massmail.jpg 35.7 KB open | download sedget 04/22/2009 Read message
BugMassEmail.jpg 95.3 KB open | download Greg2k9 06/08/2009 Read message
ame_conditional_recipients_active.jpg 10 KB open | download Joe Curia 11/03/2009 Read message
Module: Admin Mass Email
September 12, 2008 08:06PM
This mod allows the admin to send a mass email to all users, selected users, selected users based on a set of criteria, or users in selected groups. The sender can be the default admin email address or any custom email address. Various user fields and custom profile fields can be placed in the subject or body of the email, (ie. %display_name% becomes Azumandias). These fields can also be used to add conditional content (ie. {IF %posts% > "49"}{THEN "Thank you for being so active."}{/IF} becomes "Thank you for being so active." if the current user has more than 49 posts). The mass email can also contain up to three attachments.

Conditional Criteria Instructions:

This mod employs a custom set of conditional code which allows the admin to add content to the subject and body of the email based on the data for each user. The easiest way to do this is to use the "Add Conditional Content" buttons from the email creation page. This will provide the admin with an easy way to create criteria. However, each usage is limited to one IF clause with up to two AND/OR clauses, two ELSE IF clauses with up to two AND/OR clauses, and the ELSE clause. The code is capable of unlimited ELSE IF and AND/OR clauses, but these must be added manually.

The basic structure of the conditional code is as follows:
{IF %haystack% = "needle"}
  {AND %haystack% = "needle"}
  {OR %haystack% = "needle"}
  {THEN "result"}
    {ELSEIF %haystack% = "needle"}
      {AND %haystack% = "needle"}
      {OR %haystack% = "needle"}
      {THEN "result"}
{/IF}
In this structure, only the {IF}, {THEN}, and {/IF} clauses are required.

Some items to note:
- If you want to use quotes in the needle or result, you must escape them as \"
- The available operators are =, < , >, <=, >=, contains
- To express a negative operator you must add the word NOT to the code as shown in this example: {IF %admin% NOT = "1"}
- If the haystack is a date and you want to compare the needle as a date you must do so as follows:
{IF %date_last_active% < DATE "MM/DD/YYYY"}.

WARNING:
Creating this conditional code was difficult enough without adding error checking. If you use any conditional code in your email, I urge you to first preview the email before sending it out to be sure that the conditional code works in the way that you expect.

DEBUGGING: This module has three debugging options which can be set from the Edit Settings tab on the settings page. The first simply enables debugging. When enabled, the results of the first email will be logged. The second tells the debugger to log the results of each email sent. The final option allows the admin to log the emails without actually sending any out.

NOTE: When you click on "Send" the email must be formatted and sent to each user individually. This could take some time. A status page will show you the progress of your email. If you experience problems with this module, please let me know by posting here.

TODO:
- Add the ability to send HTML emails.
- Add the ability to send to CC and BCC addresses.
- Add features as they are requested.


Joe Curia (aka Azumandias)
Modules: l0Admin Mass Email00000000l000000Automatic Time Zones000ll.l00000Enhanced Custom Profiles0.00Google Calendar0000l.l000000Post Previews
000000000Admin Security Suite000000000000Check Modules for Upgrades0000External Authentication000000Group Auto-Email00000.00000Private Message Alerts
000000000Attachment Download Counter0000Custom Attachment Icons000ll.ll00Favorite Forums000000.00000Highlighted Search Terms0000Self-Delete Posts Option
000000000Attachment Watermarks0l00000000Custom Language Database00l.l.0Forum Lockdown00000.00000Ignore Forums0000000000000Threaded Tree View
000000000Automatic Message Pruning00.llll.00Easy Color Scheme Manager0l.l00Forum Subscriptions0000lll000Moderated User Group
Templates:lGeneric Integration000000000 0000Simple Rounded000000 00000000Tabbed Emerald




Edited 8 time(s). Last edit at 04/21/2009 04:58PM by Joe Curia.


Attachments:
open | download - admin_mass_email_v5_2_1_06.zip (33.9 KB)
Re: Module: Admin Mass Email
September 12, 2008 08:23PM
First of all: brilliant. This means I can strike off one of my module ideas ;-)

Second: indeed, large batches might run into troubles. If for some reason the sending is interrupted, there is a problem. The way to work around that, is to first build a full queue of messages to send, before starting the actual sending. That way, it is possible to finish the rest of the queue if sending crashes half-way. This is the field of work that I'm in for my day job (no, I don't work as a spammer ;-), so this might be my contribution for this module.

One idea: since you generate one mail per user (based on your description), it could be a nice idea to allow the use of some template variables in the message. For example %display_name% and %username% might be useful, so you could do things like:

Dear %display_name%,

blah blah


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Module: Admin Mass Email
September 12, 2008 08:49PM
Quote
Maurice Makaay
First of all: brilliant. This means I can strike off one of my module ideas ;-)

Thanks, glad I could ease your burden a bit.

Quote

Second: indeed, large batches might run into troubles. If for some reason the sending is interrupted, there is a problem. The way to work around that, is to first build a full queue of messages to send, before starting the actual sending. That way, it is possible to finish the rest of the queue if sending crashes half-way. This is the field of work that I'm in for my day job (no, I don't work as a spammer ;-), so this might be my contribution for this module.

I guess I wasn't sure how to properly work a queue without some database work. I tried to keep this as simple as possible as my web host doesn't allow use of the PEAR email modules so I wanted to build something simple enough to work for any host, as long as they allow the PHP mail function.
My one concept for working past the timeout issue would be to save any attachments to a tmp folder and use the header function to refresh the page every 5 or 10 emails with a status update. I would be glad to hear any ideas you have though.

Quote

One idea: since you generate one mail per user (based on your description), it could be a nice idea to allow the use of some template variables in the message. For example %display_name% and %username% might be useful, so you could do things like:

Dear %display_name%,

blah blah
Brilliant! This is why committees do sometimes work :) That idea never even entered my head. I will put it at the top of my todo list.


Joe Curia (aka Azumandias)
Modules: l0Admin Mass Email00000000l000000Automatic Time Zones000ll.l00000Enhanced Custom Profiles0.00Google Calendar0000l.l000000Post Previews
000000000Admin Security Suite000000000000Check Modules for Upgrades0000External Authentication000000Group Auto-Email00000.00000Private Message Alerts
000000000Attachment Download Counter0000Custom Attachment Icons000ll.ll00Favorite Forums000000.00000Highlighted Search Terms0000Self-Delete Posts Option
000000000Attachment Watermarks0l00000000Custom Language Database00l.l.0Forum Lockdown00000.00000Ignore Forums0000000000000Threaded Tree View
000000000Automatic Message Pruning00.llll.00Easy Color Scheme Manager0l.l00Forum Subscriptions0000lll000Moderated User Group
Templates:lGeneric Integration000000000 0000Simple Rounded000000 00000000Tabbed Emerald
Re: Module: Admin Mass Email
September 15, 2008 04:01AM
I have completed version 5.2.1.01 with this change:

- Added the ability to add user fields to the email such as %display_name% or custom profile fields. Thank you Maurice Makaay for this suggestion and for the javascript code for easily inserting the fields.


Joe Curia (aka Azumandias)
Modules: l0Admin Mass Email00000000l000000Automatic Time Zones000ll.l00000Enhanced Custom Profiles0.00Google Calendar0000l.l000000Post Previews
000000000Admin Security Suite000000000000Check Modules for Upgrades0000External Authentication000000Group Auto-Email00000.00000Private Message Alerts
000000000Attachment Download Counter0000Custom Attachment Icons000ll.ll00Favorite Forums000000.00000Highlighted Search Terms0000Self-Delete Posts Option
000000000Attachment Watermarks0l00000000Custom Language Database00l.l.0Forum Lockdown00000.00000Ignore Forums0000000000000Threaded Tree View
000000000Automatic Message Pruning00.llll.00Easy Color Scheme Manager0l.l00Forum Subscriptions0000lll000Moderated User Group
Templates:lGeneric Integration000000000 0000Simple Rounded000000 00000000Tabbed Emerald
Re: Module: Admin Mass Email
September 16, 2008 06:38AM
very nice Azu! Thanks also for implementing the idea of the newsletter-newsgroup! One question: how does the customfields

%phorum_mod_admin_mass_email_user_unsubscribe_setting%
%phorum_mod_group_autoemail_user_unsubscribe_setting%

work?

Thanks
Sun
Re: Module: Admin Mass Email
September 16, 2008 02:48PM
Quote
Sunbringer
very nice Azu! Thanks also for implementing the idea of the newsletter-newsgroup!

You're most welcome.

Quote

One question: how does the customfields
%phorum_mod_admin_mass_email_user_unsubscribe_setting%
%phorum_mod_group_autoemail_user_unsubscribe_setting%
work?

These are both custom profile fields created by modules (my Admin Mass Email and my Group Auto-email mods). Both are used to store unsubscribe data if you allow users to unsubscribe from the respective mod's settings page. If you do, then the users will see an unsubscribe option in their control center. If you do not, these fields will not be used.

From the perspective of this mod in its current state, the fields are more or less useless. I simply provide a list of all custom profile fields as there may be fields you or another mod create that you would want to access. In the future I hope to add conditional usage to this mod so that you could say "{IF %phorum_mod_admin_mass_email_user_unsubscribe_setting% = yes}We no you have unsubscribed, but this is important{/IF}" or "Congratulations on achieving {IF %posts% > 1000}millenialist{/IF}{ELSE IF %posts% > 100}centurion{/IF} status." Not sure when this will happen though, so don't hold your breath ;-)


Joe Curia (aka Azumandias)
Modules: l0Admin Mass Email00000000l000000Automatic Time Zones000ll.l00000Enhanced Custom Profiles0.00Google Calendar0000l.l000000Post Previews
000000000Admin Security Suite000000000000Check Modules for Upgrades0000External Authentication000000Group Auto-Email00000.00000Private Message Alerts
000000000Attachment Download Counter0000Custom Attachment Icons000ll.ll00Favorite Forums000000.00000Highlighted Search Terms0000Self-Delete Posts Option
000000000Attachment Watermarks0l00000000Custom Language Database00l.l.0Forum Lockdown00000.00000Ignore Forums0000000000000Threaded Tree View
000000000Automatic Message Pruning00.llll.00Easy Color Scheme Manager0l.l00Forum Subscriptions0000lll000Moderated User Group
Templates:lGeneric Integration000000000 0000Simple Rounded000000 00000000Tabbed Emerald
Re: Module: Admin Mass Email
September 16, 2008 09:13PM
Nice!

The %posts%-fields mighty be good to make specials to reactivate inactive user... for examples users with less than 20 Posts will get a message for a new raffle, which might be interessing. Would it be possible to add something linke this to the "send email to"-field?
Re: Module: Admin Mass Email
September 16, 2008 09:45PM
I think I opened up a whole can of worms here :-)

I will add the idea of conditional sending to my todo list.


Joe Curia (aka Azumandias)
Modules: l0Admin Mass Email00000000l000000Automatic Time Zones000ll.l00000Enhanced Custom Profiles0.00Google Calendar0000l.l000000Post Previews
000000000Admin Security Suite000000000000Check Modules for Upgrades0000External Authentication000000Group Auto-Email00000.00000Private Message Alerts
000000000Attachment Download Counter0000Custom Attachment Icons000ll.ll00Favorite Forums000000.00000Highlighted Search Terms0000Self-Delete Posts Option
000000000Attachment Watermarks0l00000000Custom Language Database00l.l.0Forum Lockdown00000.00000Ignore Forums0000000000000Threaded Tree View
000000000Automatic Message Pruning00.llll.00Easy Color Scheme Manager0l.l00Forum Subscriptions0000lll000Moderated User Group
Templates:lGeneric Integration000000000 0000Simple Rounded000000 00000000Tabbed Emerald
Re: Module: Admin Mass Email
September 17, 2008 08:49PM
Quote
Azumandias
I think I opened up a whole can of worms here :-)

I think your right ;) Thanks for your work, I was really looking forward to this for some months! Great!
Re: Module: Admin Mass Email
September 19, 2008 07:47AM
Great Mod! Thanks Azumandias!

I was looking for this time for long time ago. Well, I install it and tried to use it, but when a SEND the message, this error appears:

Error: The requested address 'phorumtest/admin.php' was not found on this server.

I know is a custom error of my WEB SYSTEM, but why is asking for 'phorumtest/admin.php' when my url is 'phorum/admin.php' ?

Thank you...
Sorry, only registered users may post in this forum.

Click here to login