Welcome PM for new registrations - Posted (3449 Views)
Junior Member
endomorph
Posts: 128
128
I have seen requests before for this but not sure if anyone did anything, so I did.
This MOD will send a PM to all new registrations - A "Welcome to our site" kind of message.
In register.asp, look for the following code -

if strEmail = "1" and strEmailVal = "1" then
'Do Nothing
else
Call DoCount
end if

regHomepage = ""

Immediately above this, insert the following code -

'<!-- Send Welcome PM Message -->

' First lets get the members ID
strSql = "SELECT " & strMemberTablePrefix & "MEMBERS.M_EMAIL "
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.MEMBER_ID "
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS"
strSql = strSql & " WHERE " & strMemberTablePrefix & "MEMBERS.M_EMAIL like '" & chkString(Request.Form("Email"),"SQLString") & "'"
set rs = my_Conn.Execute (strSql)

' This is the string for your welcome PM subject
welcomepmsubject = "Welcome to ...."

' This is the string for your welcome PM message
welcomepmmessage = "Welcome to ...."

' Do not change these
strpmtoid = rs("MEMBER_ID")
strpmrid = "1"
TF = "0"

strSql = "INSERT INTO " & strTablePrefix & "PM ("
strSql = strSql & " M_SUBJECT"
strSql = strSql & ", M_MESSAGE"
strSql = strSql & ", M_TO"
strSql = strSql & ", M_FROM"
strSql = strSql & ", M_SENT"
strSql = strSql & ", M_MAIL"
strSql = strSql & ", M_READ"
strSql = strSql & ", M_OUTBOX"
strSql = strSql & ") VALUES ("
strSql = strSql & " '" & welcomepmsubject & "'"
strSql = strSql & ", '" & welcomepmmessage & "'"
strSql = strSql & ", " & strpmtoid
strSql = strSql & ", " & strpmrid
strSql = strSql & ", '" & DateToStr(strForumTimeAdjust) & "'"
strSql = strSql & ", " & TF
strSql = strSql & ", " & "0"
strSql = strSql & ", '" & 0 & "')"


my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
set rs = nothing
'<!-- Send Welcome PM -->

Thats it ! Easy



<
Need help with your Snitz ? Most Snitz & ASP custom coding undertaken. Email for info | Search Engine Optimisation
 Sort direction, for dates DESC means newest first  
 Page size 
Posted
Senior Member
leatherlips
Posts: 1838
1838
I tried to implement this in my site but I am getting an error message:

Code:
ADODB.Field error '800a0bcd' 

Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.

/forum/register.asp, line 643
This message occurs after you click Submit on the registration form.
Line 643 in my register.asp file is:

strpmtoid = rs("MEMBER_ID")

Any ideas?
Also, I assume you would need to have the PM Mod already installed for this to work? I do but just want to clarify for others sake.<
Posted
Average Member
Andy Humm
Posts: 908
908
Leatherlips, I have the same error message and it pin points to same line
strpmtoid = rs("MEMBER_ID")

Uninstalled at the moment... BTW I have the same PM mod as yours too..<
Posted
Senior Member
weeweeslap
Posts: 1077
1077
He's using a function of an older version of snitz.<
Posted
Senior Member
leatherlips
Posts: 1838
1838
Posted
Senior Member
leatherlips
Posts: 1838
1838
I'm just bumping this because this seems like a nice feature to add to my forum. Anybody get it to work yet?<
Posted
Senior Member
MarkJH
Posts: 1722
1722
I'd like to get this to work, too. Anybody?<
Bandlink.net - http://www.bandlink.net/
Bandlink Music Forums - http://www.bandlink.net/forum/
Posted
Senior Member
MarkJH
Posts: 1722
1722
Just wanted to bump this. It feels so near to working...<
Bandlink.net - http://www.bandlink.net/
Bandlink Music Forums - http://www.bandlink.net/forum/
Posted
Average Member
modifichicci
Posts: 787
787
if you put the routine where it's said, you cannot have a member id, as member is in member pending.
you need to move the routine after the insert case in members table, around line 187 after
Call DoCount and before

'## Forum_SQL - Delete the Member<
Posted
Senior Member
leatherlips
Posts: 1838
1838
I placed the code where you said modifichicci and I did not get the error anymore. However, the Welcome PM did not get sent either to the new member. There must be something else wrong too. blackeye<
Posted
Average Member
modifichicci
Posts: 787
787
try changing
chkString(Request.Form("Email"),"SQLString")
to

chkString(rsKey("M_EMAIL"),"SQLString")

in routine<
You Must enter a message