Page 1 of 3

[mod] Proper Sequential "Autoresponder" - x-Hours and x-Days

PostPosted: 8:10am, Sat 02 Jul, 2011
by crypto2600
UPDATED: Bugfixes!! BOTH files updated as of 9pm EST - Jul 2, 2011

I have created a mod for phplist that should work with most versions, Even though the doc is large, please don't be discouraged, it's simple to mod your phplist install to make it work.

NOTE: This is NOT a repeater. You define a list of messages a user should receive an X number of hours or days from when they sign up and they receive them on queue.

Usage is simple
  • Click 'edit' on the list of your choice on the "subscriber lists" page. (/admin/?page=list)
  • Scroll to the bottom - Click 'configure' beside the "Autoresponder Features" text
  • You can send the emails within x hours or x days or signup. Queue "unlimited" messages
  • Add more with the "+ Add Another" link at the bottom of the list.
  • FYI: 1-hour = less than 1 hour - it gets picked up in the next hourly queue - if you want it at LEAST an hour later, set it to 2 hours

Configuration/Installation
  • Follow instructions in attached ODT file - You only have to modify 2 files!
  • Copy ar.php (attached) to the root folder of phplist
  • Inside ar.php set a secret random value for _RUN_KEY (Line 4)
  • If you want a report email to be dispatched to you every time the cron job runs, set value for ADMIN_REPORT_EMAIL (Report includes itemized mailout list with list ID and email title
  • _DEBUG = false or true (if _DEBUG it will modify the query a little and send to ADMIN_REPORT_EMAIL instead of the actual user)
  • Set cronjobs to run as noted below (replace values in CAPS)

Crontab Info
Code: Select all
# daily job
0 12 * * * wget http://www.YOURDOMAIN.com/lists/?p=ar\&key=YOUR_RUN_KEY > /dev/null 2>&1
# hourly job
30 * * * * wget http://www.YOURDOMAIN.com/lists/?p=arh\&key=YOUR_RUN_KEY > /dev/null 2>&1


Questions? Ask them here so they can be useful to others.

Re: [mod] Proper Sequential "Autoresponder" - x-Hours and x-Days

PostPosted: 7:46pm, Wed 06 Jul, 2011
by ashok
cannot find code
Code: Select all
if (isset($_POST["save"]) || isset($_POST["activate"]) || isset($_POST["deactivate"])) {
  $owner = $_POST["owner"];
  $title = removeXss($_POST['title']);

in Edit /admin/editlist.php

Re: [mod] Proper Sequential "Autoresponder" - x-Hours and x-Days

PostPosted: 9:36pm, Wed 06 Jul, 2011
by crypto2600
Hey there. Just do a search for "removeXss"

Re: [mod] Proper Sequential "Autoresponder" - x-Hours and x-Days

PostPosted: 12:00am, Tue 02 Aug, 2011
by andrew55
Great mod - I really appreciate your time in putting this together and making this available.

2 Quick questions for now:

1. Does this mod only send a html or text version? I see only one box for entering message data. I'm not complaining - just wanted to make sure i didn't miss anything. If so, are there plans to have it send html with MIME? This way, a recipient that can receive html newsletter will receive it, and if not, they get a text version. Or, maybe it already does this?

2. I'm fairly new to cron jobs. When entering job in hosting panel, in the following command example:

Code: Select all
# daily job
0 12 * * * wget http://www.YOURDOMAIN.com/lists/?p=ar\&key=YOUR_RUN_KEY > /dev/null 2>&1


Do I put all of this into the field for the command line (of course, while changing domain and run key)? Or, is "# daily job" considered the title of the cron job? I just wasn't sure because you had them on two separate lines in the instructions.

Thank you again for the mod and thank you for any help.

Re: [mod] Proper Sequential "Autoresponder" - x-Hours and x-Days

PostPosted: 12:26am, Tue 02 Aug, 2011
by crypto2600
1. This mod can send HTML email. In order for it to work you have to use an "HTML SYSTEM EMAILS" patch to make it send HTML Mail.The mod uses the standard sendMail() function.


2. Lines that start with # are comments. When you are using a hosting panel to set up the cron job
  • 0 12 * * * should be entered as minute = 0, hour = 12, and the rest set to * or all
  • the wget http://www.YOURDOMAIN.com/lists/?p=ar\&key=YOUR_RUN_KEY > /dev/null 2>&1 is the command to execute

Remember to substitute YOUR_RUN_KEY with the random string you enter in ar.php at the top (_RUN_KEY variable)
Substitute www.YOURDOMAIN.com with your domain name.

Does this answer your questions? If not i'm glad to help so ask

Re: [mod] Proper Sequential "Autoresponder" - x-Hours and x-Days

PostPosted: 12:52am, Tue 02 Aug, 2011
by andrew55
crypto2600 - I think I understand now how to set up the cron jobs - thank you.

As far as the html/text email question, I'm new and not familiar with the "HTML SYSTEM EMAILS" patch. I'm searching but can't seem to find info on this. Do you know of a link where I can learn more?

Also, if I do configure the mod to send html newletters, if a recipient can only except text emails, I guess this could be a problem. I'm guessing that MIME isn't available in this mod, so would it be wiser for now to send out emails in text only? Thank you for any suggestions.

Re: [mod] Proper Sequential "Autoresponder" - x-Hours and x-Days

PostPosted: 1:26am, Tue 02 Aug, 2011
by crypto2600
I believe this one should work viewtopic.php?p=37763

No attachments for these emails yet. i will add them however

Re: [mod] Proper Sequential "Autoresponder" - x-Hours and x-Days

PostPosted: 1:47am, Tue 02 Aug, 2011
by andrew55
I'm sorry, but I'm not following you. The link to the topic you sent is to a conversation about html/text emails. Please explain how this applies to what we are discussing here.

Also, I thought that phplist already has the ability to sniff out if a recipient can except html newsletters, and if not, will send them the text version. Are you stating that we need to install some type of patch/edit to give this mod the same functionality?

Sorry for the confusion - I'm just trying to make sense of the details here.

Re: [mod] Proper Sequential "Autoresponder" - x-Hours and x-Days

PostPosted: 2:43am, Tue 02 Aug, 2011
by crypto2600
no that shouldn't be necessary. No attachment support yet though. There will be.

How many attachments should an email support? Just 1? any other feedback?
Had any luck setting it up?

Re: [mod] Proper Sequential "Autoresponder" - x-Hours and x-Days

PostPosted: 3:47am, Tue 02 Aug, 2011
by andrew55
I made all the file changes, but I can't seem to get this working. No emails are being sent.

I think my cron job settings might be incorrect.

To create in a cron job in my control panel, it gives me a form field for the title of the cron job, and a form field for the cron job command. I think I understand how to fill these in.

It then has a drop down option for Frequency, which includes the options Daily and Hourly.

If Hourly in dropdown is selected, it gives me the minute options such as x:00, x:05, x:10, all the way to x:55
When I select hourly for the appropriate cron job in your instructions, would I just enter x:00 or does it matter.

If Daily in dropdown is selected, it gives me the hourly options such as 00:xx, 01:xx, 02:xx, all the way to 00:xx
When I select Daily for the appropriate cron job in your instructions, would I just enter x:00 or does it matter.

Thank you for any suggestions.

Re: [mod] Proper Sequential "Autoresponder" - x-Hours and x-Days

PostPosted: 4:11am, Tue 02 Aug, 2011
by crypto2600
there are 2 jobs you have to set up.
One is hourly, one is daily

For the one that has ?p=ar it should be daily
For the one that has ?p=arh it should be hourly

Four hourly, you can set it to x:00 or x:30 if you. that means it will run once an hour on the 00 or on the 30minute mark.

For daily, yoou can set it to 12:00. that means daily emails will be sent out at noon.

If you want to PM me, i can log in and set it up for you for free.

Re: [mod] Proper Sequential "Autoresponder" - x-Hours and x-Days

PostPosted: 6:08am, Tue 02 Aug, 2011
by andrew55
Seems to be working - thank you very much for the help. I just had the cron jobs set up weird.

Is there anyway to get placeholder [FIRSTNAME] into subject line and body of messages? Is there somewhere it can hardcoded in? It doesn't seem to be working as messages are sent (just displaying [FIRSTNAME] and not the variable).

Re: [mod] Proper Sequential "Autoresponder" - x-Hours and x-Days

PostPosted: 6:15am, Tue 02 Aug, 2011
by crypto2600
yes actually.
That is a missing feature in PHPlist, you need this to make it work: viewtopic.php?f=7&t=4966&start=0#p77848

Re: [mod] Proper Sequential "Autoresponder" - x-Hours and x-Days

PostPosted: 4:17pm, Thu 04 Aug, 2011
by andrew55
I can't seem to get the Sequential Autoresponder to work with this mod: viewtopic.php?f=7&t=4966&start=0#p77848

I think the ability to have the first name in the email subject line and body would be a great addition to your mod. Any suggestions on how to get this to work? Thank you for any suggestions.

Re: [mod] Proper Sequential "Autoresponder" - x-Hours and x-Days

PostPosted: 4:54pm, Thu 04 Aug, 2011
by crypto2600
I will start on that along with the other suggestion earlier