[add-on] Birthday Mailings

3rd party code for phpList

Re: [add-on] Birthday Mailings

Postby MrMax182 » 3:42am, Thu 22 Dec, 2011

Hi, I can't find any of the attachments or plugins mentioned on this post, is ther any place i cand find a plugin to send a birthday email to my users?
MrMax182
phpList newbie
 
Posts: 3
Joined: 3:08am, Thu 22 Dec, 2011

Re: [add-on] Birthday Mailings

Postby Hernol » 4:50am, Thu 22 Dec, 2011

Try that one, I have no idea if this version is an old one, sorry...
Attachments
birthday.zip
(7.86 KiB) Downloaded 388 times
Hernol
Admin
 
Posts: 1378
Joined: 6:39pm, Thu 18 May, 2006
Location: Argentina

Re: [add-on] Birthday Mailings

Postby MrMax182 » 5:31am, Thu 22 Dec, 2011

Hernol wrote:Try that one, I have no idea if this version is an old one, sorry...


Thanks, im triying it, it appears now in my admin but only two options appear, on birthday plugin:

main page
hello world page

none of them do nothing, any toughts?

Edit: i cant find where i customise the birthday message, is there any documentation for this? thanks in advance!
MrMax182
phpList newbie
 
Posts: 3
Joined: 3:08am, Thu 22 Dec, 2011

Re: [add-on] Birthday Mailings

Postby Hernol » 3:00pm, Thu 22 Dec, 2011

There is no documentation.
Basocally you have to create a birthday message like any other message.
Then create an attribute called "birthday" of type "date".
The you can use the plugin.
Sorry I can check for more things.

Download the file again, I uploaded something new. I havent test it though...
Hernol
Admin
 
Posts: 1378
Joined: 6:39pm, Thu 18 May, 2006
Location: Argentina

Re: [add-on] Birthday Mailings

Postby MrMax182 » 5:54pm, Thu 22 Dec, 2011

Hernol wrote:There is no documentation.
Basocally you have to create a birthday message like any other message.
Then create an attribute called "birthday" of type "date".
The you can use the plugin.
Sorry I can check for more things.

Download the file again, I uploaded something new. I havent test it though...


Thank you, its working now! i set up a cron job like this:

http://www.mysite.net/listadecorreos/ad ... inpassword.

i jave to wait a couple of days to verify everithing, thanks for all the help!
MrMax182
phpList newbie
 
Posts: 3
Joined: 3:08am, Thu 22 Dec, 2011

Re: [add-on] Birthday Mailings

Postby duncanc » 6:16am, Fri 23 Dec, 2011

MrMax182 wrote:i set up a cron job like this:

http://www.mysite.net/listadecorreos/ad ... inpassword

i jave to wait a couple of days to verify everithing, thanks for all the help!

There is a typo in the earlier post from which you copied the url for the cron job. There needs to be an & between "run" and "login"
http://www.mysite.net/listadecorreos/admin/?page=main&pi=birthday&run&login=adminlogin&password=adminpassword

You will also have to make the change identified in this post http://forums.phplist.com/viewtopic.php?p=56824#p56824 to make the "run" parameter be recognised.
duncanc
Moderator
 
Posts: 2440
Joined: 6:34am, Sat 08 May, 2010
Location: London

Re: [add-on] Birthday Mailings

Postby padster83 » 1:59pm, Wed 15 Feb, 2012

ok I have love phplist and especially this plug in, works a treat but I need a cron job to run it so I have got a workaround its ugly as hell but I am sure it may spark someone to do something better..all the patches and the code is from this forum and credit it is to them, I have just filtered it out. and bundled into a cheap workaround.
ok linux box - here are my commands hope it helps make things easier
things you need modify main.php in the birthday plugin folder line 24 to
Code: Select all
else { # do everything else, run the script...
  if (isset($_POST["run"]) || isset($_GET["run"])) {


this bash script
copy this and amend to your system
Code: Select all
#!/bin/bash
CONFIG=/YOURDETAILS/lists/config/config.php
export CONFIG
# alternatively you can use -c <path to config file> on the commandline
# run the PHPlist index file with all parameters passed to this script

from terminal point
2) cd /bin
3) nano phplistbirthday
4) paste above corrected to your details
5) cntl X to save and leave
6) chmod 777 phplistbirthday
7) yum install lynx (incase you dont have it)
8) copy this in to text editor
Code: Select all
 http://www.mysite.net/listadecorreos/admin/?page=main&pi=birthday&run&login=adminlogin&password=adminpassword
and edit for your setup
9) copy your new URL and put it in BITly to shorten it.
10) copy your new bitly short url
11) nano phplistbirthday
12) goto last line and add lynx -accept_all_cookies YOURSHORTURL
13)save and exit
14) run phplistbirthday it will work
15) create your cronjob to run phplist when you require.
16) don't forget to add killall phplistbirthday as a new cronjob 5mins after you set your phplistbirthday job to close it.

sorry linux aint my streghth, I am graphic designer, web stuff is another person department, but appreciate i need to know this stuff nowadays so learning.
padster83
phpList newbie
 
Posts: 1
Joined: 1:30pm, Wed 15 Feb, 2012

Re: [add-on] Birthday Mailings

Postby brianstorm » 1:48pm, Thu 16 Feb, 2012

Hi,

I can run this script from the webform, but when i try and run it from cron using this command

/usr/bin/php /var/www/html/domain/www/nu-list2/admin/?page=main&pi=birthday&run -c/var/www/html/domain/www/nu-list2/config/config.php ..

I get the following error

/bin/sh: run: command not found

Any ideas what this emans and how I fix it?

Thanks

Brian
Replacement Projector Lamps & Accessories in the UK
http://www.london-projectors.co.uk/projector-lamps.php
brianstorm
PL Geek
 
Posts: 138
Joined: 9:12am, Fri 26 Jun, 2009

Re: [add-on] Birthday Mailings

Postby brianstorm » 3:00pm, Thu 16 Feb, 2012

I've been doing more experimentation and the other problem Ican create by using a different cron job is this

Output from command /usr/bin/php /var/www/html/domain/www/nu-list2/admin/plugins/birthday.php ..

PHP Fatal error: Class 'phplistPlugin' not found

I had managed to create that before and it suggests something may be missing, but I don't know enough to find the phplistPlugin...

Any suggestions much apprecciated. Thanks for your time!
Replacement Projector Lamps & Accessories in the UK
http://www.london-projectors.co.uk/projector-lamps.php
brianstorm
PL Geek
 
Posts: 138
Joined: 9:12am, Fri 26 Jun, 2009

Re: [add-on] Birthday Mailings

Postby brianstorm » 4:54pm, Mon 20 Feb, 2012

With a bit more reading up on commandline, here's where I've got to now

(I'm happily running processquuee and processbunces via cron).

This command which is very similar to my existing cronjobs

USER=autoprocq1; export USER; /usr/bin/php /var/www/html/domain/www/nu-list2/admin/index.php -pmain&pi=birthday&run=run

Throws this error..

Error: main does not process commandline

This would at least indicate that the cron job is attempting to run the birthday script. The use is in my config file. I'm a bit confused by the structure of this plugin and I'm guessing that it's possibly the birthday.php that runs from the commandline, but I'm not sure how to adjust my cronjob to target this correctly.

Any thoughts or advice much apprecciated....
Replacement Projector Lamps & Accessories in the UK
http://www.london-projectors.co.uk/projector-lamps.php
brianstorm
PL Geek
 
Posts: 138
Joined: 9:12am, Fri 26 Jun, 2009

Re: [add-on] Birthday Mailings

Postby duncanc » 6:48pm, Mon 20 Feb, 2012

brianstorm wrote:USER=autoprocq1; export USER; /usr/bin/php /var/www/html/domain/www/nu-list2/admin/index.php -pmain&pi=birthday&run=run

Throws this error..

Error: main does not process commandline

I think that you cannot run the page 'main' using php command line. You will have to use an http interface using lynx or similar programs, see this earlier post http://forums.phplist.com/viewtopic.php?f=7&t=2789&start=45#p90712
duncanc
Moderator
 
Posts: 2440
Joined: 6:34am, Sat 08 May, 2010
Location: London

Re: [add-on] Birthday Mailings

Postby brianstorm » 9:45am, Tue 21 Feb, 2012

Hi,

Thanks, I had read that post... I was hoping to avoid involving Lynx, bash scripts etc, as it looks like there may be a facility to run this plugin from the commandline.

If I was to guess I'd say I'd be looking to run admin/plugins/birthday.php but I'm not sure how I rewrite the cronjob to reference this page.

This is the code that make me think it is possible,

Code: Select all
function runIt() {
  global $commandline, $I18N;

  if ($this->errorcase) {
    return 0;
  }

  if (!$commandline) {
    @flush();
    if ($this->onlycommandline) {
      $this->errorcase = 1;
      print("<p>This page can only be called from the commandline</p>");
      logEvent("This page can only be called from the commandline");
      return 0;
    } else {
      return 1; # No commandline and no BIRTHDAY_ONLYCOMMANDLINE, so it will be run from frontend
    }
  } else {
    if (!$this->onlycommandline) {
      $this->errorcase = 1;
      #logEvent("Cron is running but Birthday is disabled");
      return 0;
    } else {
      return 1; # Commandline and BIRTHDAY_ONLYCOMMANDLINE on, so it will run from commandline
    }
  }

}

function error() {

  global $commandline;

  if ($commandline && $this->errorcase) {
    ob_end_clean();
    print $GLOBALS["I18N"]->get("Cron is running but Birthday is disabled");
#    return 1;
  } elseif (!$commandline && $this->errorcase && $this->onlycommandline) {
      print $GLOBALS["I18N"]->get("This page can only be called from the commandline");
#  return 0;
  } else {
    return;
  }
}


Any further thoughts?
Replacement Projector Lamps & Accessories in the UK
http://www.london-projectors.co.uk/projector-lamps.php
brianstorm
PL Geek
 
Posts: 138
Joined: 9:12am, Fri 26 Jun, 2009

Re: [add-on] Birthday Mailings

Postby duncanc » 2:17pm, Tue 21 Feb, 2012

Its the core phplist, not the plugin, that I don't think has been designed to run aribitrary pages from the command line. It is limited to a few pages, such as send, processqueue, processbounces.

I'm not sure that the lynx example needs to be that complicated. This single-line command using wget, a similar program, seems to run the birthday plugin main page, but doesn't do anything because I haven't set up the necessary configuration items. I can't see why the command could not be run on a timed basis using cron.
Code: Select all
wget -d -O - 'http://cobh/lists/admin/?page=main&pi=birthday&login=xxx&password=xxx&run'
duncanc
Moderator
 
Posts: 2440
Joined: 6:34am, Sat 08 May, 2010
Location: London

Re: [add-on] Birthday Mailings

Postby brianstorm » 4:16pm, Tue 21 Feb, 2012

hi,

thanks for that. that wget example runs for me as a cron job....

one other note that may or may not be relevant for users. i had to chnage the primary key of the table that stores sent birthday message to be based on userid and year.... i may be using an old version of the plugin. it's different from from the one most recently posted by the author

:D
Replacement Projector Lamps & Accessories in the UK
http://www.london-projectors.co.uk/projector-lamps.php
brianstorm
PL Geek
 
Posts: 138
Joined: 9:12am, Fri 26 Jun, 2009

Re: [add-on] Birthday Mailings

Postby murillojohn » 4:47am, Sun 15 Jul, 2012

Hi!

Can anyone please upload here the phplist birthday hack fixed.zip or the birthday_mailing_plugin_by_hernol.zip file.
I can't download them from the Mantis page because they appear to be damaged.

Thanks.
murillojohn
phpList newbie
 
Posts: 1
Joined: 11:42pm, Sat 14 Jul, 2012

PreviousNext

Return to Contributions: Plug-ins, Add-ons, Mods

Who is online

Users browsing this forum: No registered users and 2 guests