Welcome, Guest. Please Login or Register.
May 05, 2024, 03:31:02 AM
Home Help Search Log in Register
News: SMF is the next generation in forum software, almost completely re-written from the ground up, make sure you don't fall for cheap imitations that suffer from feature bloat!

YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  Send email message for birthday - Let's do it « previous next »
Pages: [1] 2 Reply Ignore Print
Author Topic: Send email message for birthday - Let's do it  (Read 7114 times)
hprod
Jr. Member
**
Posts: 84


En mi debilidad me haces fuerte, Señor (San Pablo)

Send email message for birthday - Let's do it
« on: August 30, 2003, 08:32:34 AM »
Reply with quote

It would very nice to send automatic email to those who is his birthday today.
How can I do it?
Maybe it could be done as a mod?

Thanks!
Logged
Valconeye
Full Member
***
Posts: 190


Re:Send email message for birthday - Let's do it
« Reply #1 on: September 01, 2003, 02:35:08 AM »
Reply with quote

i also think this would be a great mod!
Logged
Daniel Hofverberg
YaBB God
*****
Posts: 582


WWW
Re:Send email message for birthday - Let's do it
« Reply #2 on: September 04, 2003, 11:51:30 PM »
Reply with quote

That shouldn't be too hard. I'm quite busy right now, but if no one else have helped you, I'd be happy to do it for you in a day or two - Just need a little time to look through the source files. I am reasonably experienced with PHP, I just haven't looked at the YaBB SE code a lot...
Logged
Thomas
Full Member
***
Posts: 203


WWW
Re:Send email message for birthday - Let's do it
« Reply #3 on: September 15, 2003, 02:08:23 PM »
Reply with quote

I too would love this mod Daniel.

Looking forward to testing it.

/Thomas
Logged
prod
Noobie
*
Posts: 4


I'm a llama!

Re:Send email message for birthday - Let's do it
« Reply #4 on: October 04, 2003, 06:39:18 PM »
Reply with quote

Does anyone did something like this...?
I hope...  ;D
waiting...

8)
Logged
Daniel Hofverberg
YaBB God
*****
Posts: 582


WWW
Re:Send email message for birthday - Let's do it
« Reply #5 on: October 05, 2003, 11:44:41 AM »
Reply with quote

I'm sorry, I actually forgot all about this...  ::)

I'll try to find some spare time to try and implement this - But I haven't looked through the source code too much yet, so I can't promise anything.
Logged
hprod
Jr. Member
**
Posts: 84


En mi debilidad me haces fuerte, Señor (San Pablo)

Re:Send email message for birthday - Let's do it
« Reply #6 on: October 06, 2003, 07:28:31 AM »
Reply with quote

¡Thank you very much Daniel!
I wait patiently, I'm sure we will do it
Ciao
Logged
Cerberus
Full Member
***
Posts: 100


Who's a llama?!

WWW
Re:Send email message for birthday - Let's do it
« Reply #7 on: October 07, 2003, 08:38:02 PM »
Reply with quote

Thanks in advance and good luck!
Logged

Best Regards, Cerberus
Check out http://www.pocketpcrussia.com :)
maime
Noobie
*
Posts: 34


Let there be no doubt about it...I am a flying pig

WWW
Re:Send email message for birthday - Let's do it
« Reply #8 on: October 16, 2003, 09:27:27 AM »
Reply with quote

yeah i would like that one too, with the option to make a personalized text ofcourse ;)

that would be a great mod ( for the simple machine aswell 8)
Logged
Ayeka
Jr. Member
**
Posts: 80


Good & Evil, there is never one without the other.

WWW
Re:Send email message for birthday - Let's do it
« Reply #9 on: November 05, 2003, 10:52:32 AM »
Reply with quote

There is one problem with this mod.  Is there anyway to have a scheduled event?  The actual mod would be easy enough to write:

if today=member[birthday] then
 sendemail(member)

But how would it run?  You would need some sort of scheduling agent.

I suppose you could check the time everytime the forum is accessed, but you have two problems:

1)  what if the forum isn't checked during your set time frame?
 a)  you could set the frame to an hour, or two hours, but that introduces another problem

2)  what if the form is accessed multiple times during the time frame?
 a)  then you would be sending multiple emails.
 b)  an answer to this might be to expand the members table to have  a flag birthdaySentEmail = Yes|No, but that would also bring us back to problem number 1.

Any suggestions?
Logged

--Ayeka
Master of the purple!
HAHAhahahahahaha!
Ayeka
Jr. Member
**
Posts: 80


Good & Evil, there is never one without the other.

WWW
Re:Send email message for birthday - Let's do it
« Reply #10 on: December 23, 2003, 05:18:50 PM »
Reply with quote

Try this on for size.  You'll have to make a few minor modifications, but it should do the trick.  I have this at my site and it seems to be working fine.

Things to change:
include_once ("./community/Settings.php");
$siteurl = 'http://www.mysite.com';
$boardurl = 'http://www.mysite.com/community/index.php'; (currently mine is community)
$boardname = 'Insert the name of your comminuty here';
$db_server = 'localhost';
$db_name = 'yabbse';
$db_user = 'username';
$db_pass = 'password';

         include_once ("./community/Sources/Subs.php");



<?php

include_once("./community/Settings.php");
$siteurl '';
$bbsurl '';
$boardname '';

mysql_connect ($db_server$db_user$db_pass);
mysql_select_db ($db_name);

$modSettings = array();
$request mysql_query("SELECT variable,value FROM {$db_prefix}settings WHERE (variable != 'agreement')") or database_error(__FILE____LINE__);
while (
$row mysql_fetch_array($request))
   
$modSettings[$row['variable']] = $row['value'];

$today date ('Y-m-d');
$request1 mysql_query("SELECT * FROM {$db_prefix}members;") or mysql_error();
$counter =0;

while (
$result mysql_fetch_assoc($request1))
{
   
$EmailArray[$counter] = $result['emailAddress'];
   
$counter ++;

   if (
substr($result['birthdate'],5) == substr($today,5))
   {
      
$birthyear substr($result['birthdate'],0,4);
      
$ageth substr($today 04) - $birthyear;
      
$tempdate mktime (0,0,0,1,$ageth,2000);
      
$asuf date("S"$tempdate);
      
$subject1 'Happy Birthday!';
      
$message1 'Happy birthday to you<br>
         Happy birthday to you<br>
         Happy birthday dear ' 
$result['memberName'] . '<br>
         Happy birthday to you!<br>
         <br>'
;
         if (
$birthyear <>'0000')
            
$message1 $message1 'Have a happy ' $ageth $asuf ' year and many more!<br>';
         else
            
$message1 $message1 'Have another happy year and many more!<br><br>';
      
$message1 $message1 'Regards from the ' $boardname ' community team.<br>
            <a href="' 
$bbsurl '">' $boardname '</a>';
      if (
$result['emailAddress'] <> '')
      {
         echo 
'Sending mail for ' $result['emailAddress'] . '<br>';
         include_once (
"./community/Sources/Subs.php");
         
sendmail ($result['emailAddress'], $subject1$message1);
      }
   }
}
?>



If you have any problems please let me know.

Ohh, before I forget, you also need to set up a scheduled task. in windows you can do this:

Run the scheduled tasks manager, and add the following command:

D:\php4\php D:\siteroot\birthday.php

Let it run every night.  I think Unix and Windows NT/2000 has a simular command called 'at', I'm not sure of the syntax for Unix, but Windows 2000 is:

at "02:00" /EVERY:"Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday" "D:\php4\php D:\siteroot\birthday.php"
Logged

--Ayeka
Master of the purple!
HAHAhahahahahaha!
prod
Noobie
*
Posts: 4


I'm a llama!

Re:Send email message for birthday - Let's do it
« Reply #11 on: December 23, 2003, 09:28:31 PM »
Reply with quote

WOWOWOW
Ayeka!!! Thanks a lot!! I received your IM right now!
and I'm going to test the mod now!!!

Thanks again!!!!!!!!!!
;D
Logged
Daniel Hofverberg
YaBB God
*****
Posts: 582


WWW
Re:Send email message for birthday - Let's do it
« Reply #12 on: December 23, 2003, 09:42:51 PM »
Reply with quote

The problem with that solution is that many web hosts don't allow their customers to add scheduled tasks (cronjobs in Unix/Linux).

It's an excellent solution if your web host does support cronjobs, but for those of us whose web hosts doesn't offer that, it's a lot more complicated...  :(
Logged
prod
Noobie
*
Posts: 4


I'm a llama!

Re:Send email message for birthday - Let's do it
« Reply #13 on: December 23, 2003, 10:31:55 PM »
Reply with quote

YEAHHH!!!
It works like a CHARM!!!!

THANKS AGAIN
THANKS A LOT!!!
Logged
Ayeka
Jr. Member
**
Posts: 80


Good & Evil, there is never one without the other.

WWW
Re:Send email message for birthday - Let's do it
« Reply #14 on: December 26, 2003, 06:05:39 PM »
Reply with quote

I'm sorry, I wasn't thinking about that, since I run my own server I guess it's a little too easy for me to whip stuff up like this ...  :)
Logged

--Ayeka
Master of the purple!
HAHAhahahahahaha!
Pages: [1] 2 Reply Ignore Print 
YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  Send email message for birthday - Let's do it « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.044 seconds with 19 queries.