Author Topic: Pausing emails for holidays?  (Read 1942 times)

ccroasmun

  • Posts: 5
    • View Profile
    • http://www.scriptforsale.com
Pausing emails for holidays?
« on: August 04, 2007, 10:28:30 pm »
Hi --

Is there anyway to "turn-off" listmail so that it does not go out on holidays?

Can we set certain days somewhere that the dailymail does not go out?

This would be helpful for the holiday season, etc.

Please advise

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
Pausing emails for holidays?
« Reply #1 on: August 06, 2007, 02:06:50 am »
Greetings,

The best way might be with some custom lines at the top of dailymail.php, just after the opening <?php tag:
Code: [Select]
$ymd = date("Y-m-d");
if($ymd=='2007-12-25') exit;
if($ymd=='2007-12-31') exit;

Note also that the server's time zone will come into play unless you use gmdate() in place of the date() function.  These changes will be overwritten by future updates, but then again I could also add an include for an "/xtra/daily-before.php" script where you could place the code where it wouldn't be overwritten by updates.  Let me know if this approach might work and if you foresee using it extensively enough to warrant an 'xtra' include.

Regards
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

ccroasmun

  • Posts: 5
    • View Profile
    • http://www.scriptforsale.com
Pausing emails for holidays?
« Reply #2 on: August 06, 2007, 04:32:38 pm »
Hi Dean --

I would use this on an ongoing basis so that our students would not get lessons on holidays -- so if you could include it, that would be great.

I'll be happy to pay for your time.

Thanks,
Cheryl
scriptforsale.com

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
Pausing emails for holidays?
« Reply #3 on: August 06, 2007, 09:31:37 pm »
Hi Cheryl,

This took me about 5 minutes and helps all LMP owners so don't worry about payment. :)

To implement it, do this:

Open dailymail.php and after this line (near line 26):
Code: [Select]
if ($isadmin == 'true' || $islogged == 'true'){
Add this:
Code: [Select]
 // check for daily-pre-xtra.php
  if(file_exists('./daily-pre-xtra.php')){
    include('./daily-pre-xtra.php');
    mysql_select_db($sqldb);
  }

Next, create a new file "daily-pre-xtra.php" and put it in your main ListMail folder.  It should contain the code I mentioned previously, wrapped in PHP tags, ie:
Code: [Select]
<?php// skip dailymail days based on YMD$ymd = date("Y-m-d");if($ymd=='2007-12-25') exit;elseif($ymd=='2007-12-31') exit;elseif($ymd>'2008-01-01' && $ymd<='2008-01-07') exit; // first 7 days of january?>

I have added the include to future updates.

Regards
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting