Print Page | Close Window

MOD Request - Birthday E-Mail

Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums Modifications
Forum Description: Mod's and Add-on's for Web Wiz Forums.
URL: https://forums.webwiz.net/forum_posts.asp?TID=20842
Printed Date: 28 March 2026 at 2:21pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: MOD Request - Birthday E-Mail
Posted By: ToJaRo
Subject: MOD Request - Birthday E-Mail
Date Posted: 27 July 2006 at 6:26pm
I am not sure if this is possible but I would like to have a mod that would read the DB to see if a members b-day was on that day and then send them a pre-made email to say Happy B-Day. 
Would this be a difficult request?


-------------
ToJaRo
http://www.thesoupbone.com - The SoupBone Community



Replies:
Posted By: dfrancis
Date Posted: 27 July 2006 at 6:30pm
That's a great idea!!


Posted By: aks427
Date Posted: 27 July 2006 at 8:27pm
The difficulty with that is, you would need to set it up your server to run that check each day.


Posted By: ToJaRo
Date Posted: 27 July 2006 at 8:33pm
I assume you mean a SQL script that checks the DB as a scheduled task daily.   How would you then generate the email?
 
I run my own servers so getting access to them is not an issue.... I just dont have the asp/SQL experience to pull this kinda task off.
 
My thought was making it as simple as a email notification.  Users get notifications to replies to their post or even a new post.  The b-day email should be similar to that.


-------------
ToJaRo
http://www.thesoupbone.com - The SoupBone Community


Posted By: dpyers
Date Posted: 27 July 2006 at 10:18pm
email notifications are triggered by someone physically posting. There's no built in facility in IIS to automatically trigger something on most web hosts. But with access to the server, you can use the windows scheduler to run an asp script that hits the db and tthen sends the email.

If it's set up for it, you can also use ms sql mail to send something direcly from the db server.


-------------

Lead me not into temptation... I know the short cut, follow me.


Posted By: ToJaRo
Date Posted: 27 July 2006 at 10:26pm

Where can I find such a script?  I am thinking it would be custom.  Can anyone direct me in the right direction to accomplish this?



-------------
ToJaRo
http://www.thesoupbone.com - The SoupBone Community


Posted By: Demon
Date Posted: 27 July 2006 at 11:19pm
Someone doesn't have to 'physically' post, they can just be browsing a page, and the page could do a logic test for birthdays. You can fake an automatic birthday email by creating a script on the common.asp page, or make a new page and include it in the common.asp page.

In theory, whenever any page in the forum is loaded the script would execute by checking for any birthdays on the current date, check to see if a flag has been setup yet saying when the last birthday email was sent, if there is none or its from last year then execute a block of code that emails a preset birthday message to the user who's birthday it is. The script would then set the mentioned flag for the Date/Time that the email was sent; this would prevent the script from emailing a user multiple times, since anyone that accesses your forum will basically make that script run.

-------------
So Sayith the Demon.


Posted By: dfrancis
Date Posted: 27 July 2006 at 11:40pm
I would imagine that everyone checks their forums every day... well except for dp (grin). Any traffic can trigger the routine. I like the idea so much I'm thinking of writing it myself.
 
 
 
 Be afraid... be very afraid. LOL


Posted By: dpyers
Date Posted: 27 July 2006 at 11:49pm
lol.
If your win boxes are booted once a day, you can also put something in the application_onstart event in global.asa. You would have to check if it had already run for the day as apps/iis can be restarted several times a day.


-------------

Lead me not into temptation... I know the short cut, follow me.


Posted By: Demon
Date Posted: 28 July 2006 at 12:15am
Originally posted by dfrancis dfrancis wrote:

I would imagine that everyone checks their forums every day... well except for dp (grin). Any traffic can trigger the routine. I like the idea so much I'm thinking of writing it myself.



Be afraid... be very afraid. LOL


lol, nice to know. XD

-------------
So Sayith the Demon.


Posted By: dfrancis
Date Posted: 28 July 2006 at 12:08pm
Originally posted by dpyers dpyers wrote:

lol.
If your win boxes are booted once a day, you can also put something in the application_onstart event in global.asa. You would have to check if it had already run for the day as apps/iis can be restarted several times a day.
 
Yes, I was trying to avoid the need for another table but the best way (I think) is to annotate the email had been sent. My other concern is those people who may not want to receive the auto birthday "spam." Perhaps a new table is the only way to annotate a preference too.
 
I really liked your idea about SQL server scheduled task. Have you done anything like that before?


Posted By: dfrancis
Date Posted: 28 July 2006 at 2:22pm
I think I've come up with an idea that will prevent the need for a new table. I'm working on it now and will submit it for critical review shortly.


Posted By: dpyers
Date Posted: 28 July 2006 at 4:39pm
Originally posted by dpyers dpyers wrote:



If it's set up for it, you can also use ms sql mail to send something direcly from the db server.


You can use MS SQL Agent on the db server to schedule and run a stored proc and use MS SQL Mail to send the results.


-------------

Lead me not into temptation... I know the short cut, follow me.


Posted By: dfrancis
Date Posted: 28 July 2006 at 7:12pm

broken script removed by self



Posted By: dfrancis
Date Posted: 28 July 2006 at 7:12pm
Originally posted by dpyers dpyers wrote:

Originally posted by dpyers dpyers wrote:



If it's set up for it, you can also use ms sql mail to send something direcly from the db server.


You can use MS SQL Agent on the db server to schedule and run a stored proc and use MS SQL Mail to send the results.
 
I may use that someday... thanks for the brilliance.


Posted By: ToJaRo
Date Posted: 28 July 2006 at 8:01pm
Originally posted by dfrancis dfrancis wrote:

 

What you have to do is insert a file include BELOW the configuration data setup. I put it right below the windows authentication call.

'******************************************
'*** Windows Authentication Login ****
'******************************************

If blnWindowsAuthentication Then Call windowsAuthentication()

'******************************************
'*** Birthday addon ****
'******************************************

%><!--#include virtual="/bdayemail.asp"--><%

'******************************************
'*** Setup Last Visit Data ****
'******************************************

'Read in the last visit date
 
Ok... understood everything except in what file to place the above code and what is used to call it and how frequently is it called... daily, hourly, etc.
 
Thanks a million for the assistance.     I will test as soon as I know the answers.


-------------
ToJaRo
http://www.thesoupbone.com - The SoupBone Community


Posted By: dfrancis
Date Posted: 28 July 2006 at 8:10pm
It calls it every time any page of your forum is called. It's in the common.asp but simply looks for the application variable and if it's there, it doesn't do anything. So it should be insignificant to the performance of your forum.
 
Just place that include at or around line 105 of /common.asp and create the new file in the root too.


Posted By: ToJaRo
Date Posted: 28 July 2006 at 8:13pm
thx!  will test and let you know!

-------------
ToJaRo
http://www.thesoupbone.com - The SoupBone Community


Posted By: ToJaRo
Date Posted: 28 July 2006 at 8:36pm

Ok... I musta done something wrong... I copied the


'******************************************
'*** Birthday addon ****
'******************************************

%><!--#include virtual="/bdayemail.asp"--><%

in between the lines as said above on common.asp
 
I then created a file called bdayemail.asp in the root of my forum where the common.asp file is and created a new user with a birthday on today.  I then went to as many places on my site as I could and never recieved the email.  I did recieve the registration email and I checked my junk email to make sure it had not gone there.
 
Suggestions on what I may have done wrong or need to do?


-------------
ToJaRo
http://www.thesoupbone.com - The SoupBone Community


Posted By: dfrancis
Date Posted: 28 July 2006 at 8:47pm
did you get the PM?


Posted By: ToJaRo
Date Posted: 28 July 2006 at 8:50pm

Ooops should have mentioned that...

No I did not.



-------------
ToJaRo
http://www.thesoupbone.com - The SoupBone Community


Posted By: dpyers
Date Posted: 28 July 2006 at 8:50pm
Did you get a PM?

-------------

Lead me not into temptation... I know the short cut, follow me.


Posted By: dfrancis
Date Posted: 28 July 2006 at 8:55pm
hold off using that for a minute... I'm working out a bug... thanks.


Posted By: dfrancis
Date Posted: 28 July 2006 at 8:55pm
I got about 900 pms so there is something not right in the query... brb


Posted By: dfrancis
Date Posted: 28 July 2006 at 9:06pm
figured it out... my query is flawed in the DOB lookup. It only works on the day they were born... I'll be back.


Posted By: dfrancis
Date Posted: 28 July 2006 at 9:43pm
Okay.. I figured out that problem and found a couple more... don't use that which I posted... as a matter of fact... I'm removing it now.
 
Oh... the new query?
 
bdsql = "SELECT " & strDbTable & "Author.Real_name, " & strDbTable & "Author.Author_email " &_
"FROM " & strDbTable & "Author "&_
"WHERE (DATEPART(d, dob) = "&DATEPART("D",date())&" AND DATEPART(m, dob) = "&DATEPART("M",date())&")"


Posted By: ToJaRo
Date Posted: 28 July 2006 at 9:56pm
So... thats the new query I should use on bdayemail.asp?  Or are you rewriting that page?

-------------
ToJaRo
http://www.thesoupbone.com - The SoupBone Community


Posted By: ToJaRo
Date Posted: 28 July 2006 at 10:05pm
NM... I think you were asking the others if your code looked correct. Sorry.

-------------
ToJaRo
http://www.thesoupbone.com - The SoupBone Community


Posted By: dfrancis
Date Posted: 28 July 2006 at 10:38pm
I'm having a heck of a time with the date in the PM field. I hit a block and hope someone can remember the answer to this simple question.
 
"WHERE (PM_Tittle = '123456') AND (PM_Message_date = "&date()&")"
 
It is not working because PM_Message_date is a long version. I cannot remember for the life of me how to query the field for the date match.
 
Oh... I'll think of it at 2 in the morning and come running back to the office I'm sure. Anyway, I'll be here for a while if someone can remember.
 
David @ 4:38pm local


Posted By: Demon
Date Posted: 28 July 2006 at 10:45pm
Are you saying that PM_Message_Date is of the datatype Long? If so, the VBScript function CLng(date()) should work.

-------------
So Sayith the Demon.


Posted By: dfrancis
Date Posted: 28 July 2006 at 10:49pm
no luck
 
   "WHERE (PM_Tittle = '123456') AND (PM_Message_date = "&CLng(date())&")"


Posted By: dfrancis
Date Posted: 28 July 2006 at 11:12pm
I gave up and used this... it works.
 
 
bdsql = "SELECT " & strDbTable & "PMMessage.PM_Tittle, " & strDbTable & "PMMessage.PM_Message_date "&_
"FROM " & strDbTable & "PMMessage "&_
"WHERE (PM_Tittle = '123456') AND (DATEPART(d, PM_Message_date) = "&DATEPART("D",date())&" AND DATEPART(m, PM_Message_date) = "&DATEPART("M",date())&" AND DATEPART(y, PM_Message_date) = "&DATEPART("Y",date())&")"


Posted By: dfrancis
Date Posted: 28 July 2006 at 11:18pm
I change my mind and went with this thanks to this guy's advice...
 
http://www.databasejournal.com/features/mssql/article.php/10894_2209321_2 - http://www.databasejournal.com/features/mssql/article.php/10894_2209321_2
 
 
 
bdsql = "SELECT " & strDbTable & "PMMessage.PM_Tittle, " & strDbTable & "PMMessage.PM_Message_date "&_
"FROM " & strDbTable & "PMMessage "&_
"WHERE (PM_Tittle = '123456') AND CAST(FLOOR(CAST(PM_Message_date AS FLOAT))AS DATETIME) = '"&date()&"'"


Posted By: ToJaRo
Date Posted: 28 July 2006 at 11:32pm
I replaced that line of code in the bdayemail.asp page and it still hasn't sent me a PM or Email.
 
Do I need to change more or have a jumped the gun again?


-------------
ToJaRo
http://www.thesoupbone.com - The SoupBone Community


Posted By: dfrancis
Date Posted: 28 July 2006 at 11:37pm

I will be posting a new version in a few minutes... there are so many changes that it's better to start from scratch. You'll have the same file, just a new version of it. :)

It turns out that I had not included the sendmail functions or anything. MyBad.



Posted By: ToJaRo
Date Posted: 28 July 2006 at 11:48pm
Great! Thanks again!

-------------
ToJaRo
http://www.thesoupbone.com - The SoupBone Community


Posted By: dfrancis
Date Posted: 28 July 2006 at 11:50pm
 

Okay... I'm sorry that I deleted that other post now. Phooey.

Here's the code you are waiting for, simply replace the code in the include file with this...


<%

DIM bdsql ' string variable for birthday sql
DIM bdstr ' string variable for birthday string
DIM needtosend ' I needed to make a bln so I could close the rs

If Application(strAppPrefix & "Bdaysent") = Date Then  

 	' this means it's already run and there's nothing to do.
 
Else
%><!--#include file="functions/functions_send_mail.asp" --><%
	' the database is already open in the common.asp so we have no need to open it.

	'first things first, let's check the private messenger for the entry for today.


bdsql = 	"SELECT " & strDbTable & "PMMessage.PM_Tittle, " & strDbTable & "PMMessage.PM_Message_date "&_
	"FROM " & strDbTable & "PMMessage "&_
	"WHERE (PM_Tittle = '2073991i') AND CAST(FLOOR(CAST(PM_Message_date AS FLOAT))AS DATETIME) = '"&date()&"'"


	'Query the database (looking for our PM flag)

	rsCommon.Open bdsql, adoCon

      If rsCommon.EOF Then ' empty recordset, so I need to process further.
      	needtosend = true
      Else
      	needtosend = false
      End if 

	rsCommon.close ' I'm gonna need that in my functions

    If needtosend then
      
      Call SendBirthdayEmail()
      Call SendBirthdayPM()
      Call WriteBirthdayToApplication()
    
    Else
    
       ' There is no PM on record so we need to go ahead and process the birthdays.
      
      Call WriteBirthdayToApplication() 
    
    end if

end if

DIM bdayarray, numberofmessagessent, i, stringHappyBirthday, p

Function SendBirthdayEmail()


' 1st, we need to get a list of all people with birthdays today... ya think?

bdsql = 	"SELECT " & strDbTable & "Author.Real_name, " & strDbTable & "Author.Author_email " &_
	"FROM " & strDbTable & "Author "&_
	"WHERE (DATEPART(d, dob) = "&DATEPART("D",date())&" AND DATEPART(m, dob) = "&DATEPART("M",date())&")"

 rsCommon.Open bdsql, adoCon

  If rsCommon.EOF Then
  	' there are no birthdays
  
  	rsCommon.close
  	exit function
  Else
  
  	' let's make an array since we want to close the rs ASAP.
  	
  	bdayarray = rsCommon.GetRows
  	rsCommon.close
  
  	numberofmessagessent = 0 ' mostly for classy email
  
  	For i = 0 to uBound(bdayarray,2)
  	
  	'This is your happy birthday message sent in plain text. 
  	 stringHappyBirthday =  "Dear "&decodeString(bdayarray(0,i))&","&VbLF&VbLf&_
  			      "The members, moderators and managers of "&strMainForumName&_
  			      " would like to wish you a happy birthday."
  
  	    Call SendMail(stringHappyBirthday,decodeString(bdayarray(0,i)),decodeString(bdayarray(1,i)),strMainForumName,strForumEmailAddress,"Happy Birthday from "&strMainForumName, strMailComponent, false)
  		
  	  numberofmessagessent = numberofmessagessent+1 ' you'll see why in a second.
  
  	Next
  	
  		' this is one of those exception anal things I do.
  		if numberofmessagessent > 1 then
  			p = "'s were"
  		Else
  			p = " was"
  		End If	
  
  	' Now send an email to the forum address just so we know we sent and to whom
  
  
  
  	stringHappyBirthday = 	"You will be happy to know that "&numberofmessagessent&_
  				" happy birthday E-Mail"&p&" sent today @ "&Now()&" (Server Time)."
  
  
  
  	stringHappyBirthday = stringHappyBirthday &VbLF&VbLf&" Messege"&p&" sent to:"&VbLF&VbLf
  
  	For i = 0 to uBound(bdayarray,2)
  
  		stringHappyBirthday = stringHappyBirthday & decodeString(bdayarray(0,i)) &VbLF 
  
  	Next
  	
  	' This will send an email to the admin listing the "real names" of everyone sent an email.
  	' I may change it to user names.
  	Call SendMail(stringHappyBirthday,strMainForumName,strForumEmailAddress,strMainForumName,strForumEmailAddress,"Happy Birthday email sent", strMailComponent, false)
  end if



End Function


' This is how I solved the issue of duplicate email and not wanting
' to create another table or modify an existing one.
' All it does is send a private message to the master admin account
' so we can look for it later. 
' Frankly, this part is untested because I've not processed the email or this function yet.
' I'd be interested in your results.
' And yes, this is boRg's code all the way down to the spelling.

Function SendBirthdayPM()

       strSQL = "SELECT" & strDBTop1 & " " & strDbTable & "PMMessage.* " & _
		"FROM " & strDbTable & "PMMessage" & strRowLock & ";"

	With rsCommon

		'Set the Lock Type for the records so that the record set is only locked when it is updated
		.LockType = 3

		'Open the recordset
		.Open strSQL, adoCon

		'Check to make sure the message is not already sent to the user


		'Save the pm


			'Add new record to recordset
			.AddNew
			
			.Fields("Author_ID") = 1 ' this should be changed to the specific user
			.Fields("From_ID") = 1
			.Fields("PM_Tittle") = "2073991i"
			.Fields("PM_Message") = "birthday sent"
			.Fields("PM_Message_date") = now()
			.Fields("Email_notify") = strDBFalse
			.Update

			


		'Clean up
		.Close
	End With


End Function

Function WriteBirthdayToApplication()

	Application.Lock

	'Update the application level variable
	Application(strAppPrefix & "Bdaysent") = Date

	'Unlock the application
	Application.UnLock

end Function
%>


Posted By: ToJaRo
Date Posted: 29 July 2006 at 12:00am
 

Microsoft VBScript compilation error '800a03ee'

Expected ')'

/bdayemail.asp, line 118

Call SendMail(SendMail stringHappyBirthday,strMainForumName,strForumEmailAddress,strMainForumName,strForumEmailAddress,"Happy Birthday email sent", strMailComponent, false)
-----------------------^


-------------
ToJaRo
http://www.thesoupbone.com - The SoupBone Community


Posted By: dfrancis
Date Posted: 29 July 2006 at 12:31am
whups
 
Call SendMail(SendMail stringHappyBirthday
 
should be
 
Call SendMail(stringHappyBirthday


Posted By: dfrancis
Date Posted: 29 July 2006 at 12:37am
It's tested a lot more thoroughly now. I know the PM feature works as well as the sendmail. You should not have any trouble now.
 
One thing! If you delete the PM and your server gets restarted, there is a chance that your birthday people will receive a duplicate email. During my testing I got zillions of them... sheesh.
 
I had explained what this does at length in an earlier post but removed the whole post when we found some errors. I'm regretting that decision.
 
In a nut shell, I was trying to create a method of automatically sending a birthday email to anyone in the forum who has entered a birthday for the day. Since there is no way to truly schedule an event, I added an include in the common.asp that would run a routine to check for DOB but with a little protection.

It looks for a new application variable and if it's not there runs the script.

Since Application variables can be erased by resetting the server or even saving your global.asa, I wanted to document the sending of the email somehow. My first thought was to create a table but that always gets complicated. I opted for sending the admin account a private message (PM) and then using that as a point of reference before completing the script.

So now:

look for application variable, if not found, look at PM, if not there, check db for DOB today, send an email, send the PM and make the application array. How's that for a nutshell of 185 lines of code?

Anyway... I was just playing a little. I'm not a mod maker so use it at your own risk.

To use it, include the new file at line 105 or so in the common.asp and then create the include as posted above.

Good luck. (finger crossed.)

 



Posted By: ToJaRo
Date Posted: 29 July 2006 at 12:46am
Man... I gotta be doing something wrong. I still do not get an EMail or PM.  Which account should be getting the PM? Administrator?
 
Is there any custom attribute I need to do to this code?  Here is a brief overview of my setup...
 
Web Server - Server 1
SQL Server - Server 2
Mail Server - Server 3
 
All three are on seperate boxes... does your code think that SQL is installed on the same box as the code is located?
 
Thanks again for all ur time and work!


-------------
ToJaRo
http://www.thesoupbone.com - The SoupBone Community


Posted By: dfrancis
Date Posted: 29 July 2006 at 1:01am
No... it's using the same variables you defined in the set up of the forum. The key to testing is to change the name of the application variable while you're messing with it. Once that is set, it's difficult to test.
 
I was able to make it run without modifying anything other that what I mentioned. The common.asp line and the added file. Everything else is off the shelf so to speak. Sorry you're having trouble.
 
David


Posted By: dfrancis
Date Posted: 29 July 2006 at 1:07am
I had a thought... when you got the scripting error, you likely set the application variable... try removing it and see what happens.
 
For testing, all I did was change the virst line in the include to this...
 
If Application(strAppPrefix & "Bdaysent") = Date+1 Then 


Posted By: ToJaRo
Date Posted: 29 July 2006 at 1:20am
Still isnt working... I did the date +1 and added a new user with the birthdate of tomorrow.
 
Very odd that it works on yours and not mine.  I will start fresh in a while by extracting a new comman.asp file and deleting and recreating the bdayemail.asp file.
 
Thanks again for assisting me!


-------------
ToJaRo
http://www.thesoupbone.com - The SoupBone Community


Posted By: dfrancis
Date Posted: 29 July 2006 at 1:27am
Good luck... be sure and write down any errors. I'll try to help tomorrow.
 
Also... a little tip. If you want to clear your application variables, just edit (or create) the global.asa file in the root. Modifying this file in any way will purge your session and application vars.
 
 


Posted By: dfrancis
Date Posted: 03 August 2006 at 11:36am
well... what happened?


Posted By: theman17
Date Posted: 04 August 2006 at 10:15pm
Just wondering as well.


Posted By: ToJaRo
Date Posted: 04 August 2006 at 10:45pm
I have not worked on it since my last post... been busy at work and on other projects... I will work on it this weekend and post my findings.
 
 


-------------
ToJaRo
http://www.thesoupbone.com - The SoupBone Community


Posted By: dfrancis
Date Posted: 04 August 2006 at 11:49pm
Thanks for letting me know... I was feeling like all that was wasted. I did get a PM from someone else who is going to try it so maybe that person will post their results as well.
 
It has worked flawlessly on my test board.


Posted By: dfrancis
Date Posted: 06 August 2006 at 3:05pm
Originally posted by theman17 theman17 wrote:

Just wondering as well.
 
huh?


Posted By: ToJaRo
Date Posted: 06 August 2006 at 4:53pm

I think he was saying he was wondering as well whether or not I got it working.

I did not... I have completely deleted my DEV Site, recreated it, and then placed your code in the files as instructed. Still no luck.  I created another test user with a B-Day of today and it shows up at the bottom of the page.
 
This code is for the SQL version of WWF correct?  I say that because I had another project I was working on that did not work because I had the Access DB code instead SQL.
 
If this is for SQL than do you have any other thoughts?


-------------
ToJaRo
http://www.thesoupbone.com - The SoupBone Community


Posted By: dfrancis
Date Posted: 06 August 2006 at 6:02pm
Ah HA! That is the issue I would think. I have no way to test this for Access I'm sorry. (I left Access a long time ago.) The query could probably be simplified to query the access dbase, I'm thinking the sql for the datepart if what is breaking the script. Again, I'm very sorry, I didn't know it was for Access.
 
But hey, now I have a cool script for my site eh?
 


Posted By: ToJaRo
Date Posted: 06 August 2006 at 8:13pm

Slight miscommunication...

My site is and has been MS SQL.. the other project was using Access DB codes and not SQL so it did not work.  If your code is for SQL then I am still unsure why my site will not work with it.


-------------
ToJaRo
http://www.thesoupbone.com - The SoupBone Community


Posted By: dfrancis
Date Posted: 07 August 2006 at 12:33pm
Give me a few days, I've got Jury duty this month so it is making it difficult to keep up with things I have to do vs things I want to do. I have provisioned a new sub domain for a standard install of wwf 8.03 sql. I will test the script and find the flaws on that install.
 
I should be able to find any holes in the script by doing it this way.


Posted By: ToJaRo
Date Posted: 07 August 2006 at 2:03pm
No problem... I have thought about doing a clean slate install and trying the code in a sub-domain as well I just have not gotten to it yet.  My DEV site is a copy of my live site pointed to a copy of my live DB.
 
Not sure if that would cause an issue but I try to make my DEV as close to my site as possible so that testing will be accurate.


-------------
ToJaRo
http://www.thesoupbone.com - The SoupBone Community


Posted By: ToJaRo
Date Posted: 09 August 2006 at 2:05pm
Ok... ready for some wierdness?
I have not touched my DEV site since my last post on here and was gonna go back this weekend to see what I could accomplish...  This morning I wake up to an email sent from my server to me stating that an Birthday E-Mail had been sent to a member who's b-day is today.    What changed? Nothing to my knowledge.
 
I wonder if it is because my testing scenario required me to create a new user with their b-day on the same day I was testing?
 
I am not sure what changed or if it was ever broke but it seems to be working now... I think. 


-------------
ToJaRo
http://www.thesoupbone.com - The SoupBone Community


Posted By: dfrancis
Date Posted: 09 August 2006 at 3:00pm

Ah yes... if you created the user after the script ran, then it's too late. I was thinking about that too but the solution is complicated in that you would have to intercept new user registrations to see if it happens to be their birthday. Also, if a user logs on and changes (or adds) their birthday after the script runs, they won't get one either.

I'm glad it's working... I was scratching my head on that one.


Posted By: ToJaRo
Date Posted: 10 August 2006 at 1:26am
Yes I am glad as well!   Thanks again for creating the mod and assisting me to get it working.  Now I just wanna tweak the email to have some custom saying on it that is relevant to the site. 
 
You should zip up the bdayemail.asp and common.asp page and add them to this topic so that everyone can use it... and also post it in the MOD Index as I am sure there are lots of people out there that would use it.
 
I don't mind doing zipping up the files but I don't wanna steal your glory!
 
You da man!


-------------
ToJaRo
http://www.thesoupbone.com - The SoupBone Community


Posted By: wistex
Date Posted: 13 August 2006 at 11:36am
Looks good.  I think I'll try this.
 
One tip for large forum boards or boards with slow SMTP servers, you will not want to have this script triggered by user activity, but rather scheduled to run everyday by Windows.  Otherwise that unlucky visitor will have the page waiting to load while it sends all the e-mails.  When the e-mails are sent, the page will then load.  I already have this problem with some popular threads where a lot of people subscribe.  When someone posts a new post, it takes a long time before they get redirected back to the thread because its busy sending out e-mails.
 
For smaller boards, its probably not as much of an issue.  But something to be aware of when you grow.


-------------
http://www.wistex.com" rel="nofollow - WisTex Solutions
http://www.caribbeanchoice.com/forums" rel="nofollow - CaribbeanChoice Forums


Posted By: dfrancis
Date Posted: 13 August 2006 at 2:29pm

THANKS!

Good point!
On a popular board, the first hit would likely be in the middle of the night by a search engine or something. Once that first hit is through there is no more sendmail.
 
It's a good idea to schedule the event anyway and I was actually looking at the DTS schedule idea from DP. But for this I was trying to make it simple.
 
The number of emails sent would be relatively low unless you had an amazingly popular forum. (Hope for this we all do.)
 
One of the biggest forums I've ever seen personally...
 
Posts: 26,947,989
Members: 159,035
Threads: 3,349,189
 
I looked at their calendar and during this month, they do not exceed 200 birthdays in any given day. Sending 200 emails shouldn't take too long.
 
http://www.christianforums.com/calendar.php - http://www.christianforums.com/calendar.php
 


Posted By: wistex
Date Posted: 13 August 2006 at 3:57pm
Originally posted by dfrancis dfrancis wrote:

I looked at their calendar and during this month, they do not exceed 200 birthdays in any given day. Sending 200 emails shouldn't take too long.
Unless your web server or SMTP server is slow.  But if that is the case, a hardware upgrade is usually in order anyway.


-------------
http://www.wistex.com" rel="nofollow - WisTex Solutions
http://www.caribbeanchoice.com/forums" rel="nofollow - CaribbeanChoice Forums



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net