Author |
Topic |
|
Dave Goldman
New Member
USA
65 Posts |
Posted - 31 October 2009 : 16:12:26
|
Hey guys, I have a fast question. I wrote some code so I can send an email to the user if it is their birthday. I am piggybacking off of another function from a mod and I would like to know the best way to retrieve the users name and email address.
function EmailUserBirthdayNotice Dim userName, userEmail ' Need to retrieve the data '## E-mails Message to the Author of this Reply. strRecipientsName = userName strRecipients = userEmail strFrom = "My Forum" strFromName = strForumTitle strsubject = "Happy Birthday " & userName & " !" strMessage = "Hello " & PWMember_Name & vbNewline & vbNewline strMessage = strMessage & "You received this message from My Forum because today is your birthday. We wanted to wish you a Happy Birthday!" & vbNewline & vbNewline strMessage = strMessage & vbNewLine & "Have a great birthday!." & vbNewLine & vbNewLine strMessage = strMessage & vbNewLine & "My Forum" & vbNewLine & vbNewLine %> <!--#INCLUDE FILE="inc_mail.asp" --> <% end function
Thanks Dave |
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 01 November 2009 : 03:59:45
|
|
Edited by - Carefree on 02 November 2009 09:29:59 |
|
|
modifichicci
Average Member
Italy
787 Posts |
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 01 November 2009 : 05:37:29
|
Not if he's going to manually run the program from an admin console page - it'll only send one per person with a birthday on that date. If he embeds it in a commonly accessed page, then you're correct, it would send the emails every time that function was called. |
|
|
Dave Goldman
New Member
USA
65 Posts |
Posted - 01 November 2009 : 07:57:55
|
Is there an easy way to check for that? Possibly adding a new field to the database? I think this would be a cool add in. What I did was took an old post that basically checked the birthday by calling two functions isbday and getGreeting. Basically I just wanted to send the email one time if it was the birthday as these two functions just say happy birthday in the header. |
|
|
modifichicci
Average Member
Italy
787 Posts |
Posted - 01 November 2009 : 08:22:46
|
quote: Not if he's going to manually run the program from an admin console page
not very comfortable... I have implemented the function, but it needs the event mod and the birthday mod, adding a new field M_SENTMAIL to MEMBERS_BDATES table That is possible as the mod store the dob in that table and delete them after sometimes, so the field is set to 0 again next time..
|
Ernia e Laparocele Forum di Ernia e Laparocele Acces - MySql Migration Tutorial Adamantine forum |
|
|
Dave Goldman
New Member
USA
65 Posts |
Posted - 01 November 2009 : 09:14:20
|
I do have both mods installed. Do you want me to test it? Do you have the link to the exact event mod just so I can make sure I have the same one as you? |
|
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 02 November 2009 : 08:35:42
|
quote: ...it needs the event mod and the birthday mod, adding a new field M_SENTMAIL to MEMBERS_BDATES table
Not really. All you'd have to do is add a variable to "config.asp", store the date in it when it starts to send EMails. Then when the function is called, check the value of the variable. If it matches the current date, don't send. Done.
I made the appropriate change in above post. |
Edited by - Carefree on 02 November 2009 09:30:30 |
|
|
|
Topic |
|