Welcome PM for new registrations

Snitz™ Forums 2000
https://forum.snitz.com/forumTopic/Posts/66663?pagenum=1
05 November 2025, 01:31

Topic


endomorph
Welcome PM for new registrations
16 March 2008, 03:24


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



<

 

Replies ...


leatherlips
19 March 2008, 18:41


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.<
Andy Humm
19 March 2008, 18:59


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..<
weeweeslap
19 March 2008, 19:05


He's using a function of an older version of snitz.<
leatherlips
20 March 2008, 07:17


Is there any tweaking that could get this to work with the newer code?<
leatherlips
28 April 2008, 08:56


I'm just bumping this because this seems like a nice feature to add to my forum. Anybody get it to work yet?<
MarkJH
30 April 2008, 11:48


I'd like to get this to work, too. Anybody?<
MarkJH
03 May 2008, 07:41


Just wanted to bump this. It feels so near to working...<
modifichicci
03 May 2008, 07:53


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<
leatherlips
03 May 2008, 08:29


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<
modifichicci
03 May 2008, 09:09


try changing
chkString(Request.Form("Email"),"SQLString")
to

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

in routine<
leatherlips
03 May 2008, 09:18


Originally posted by modifichicci
try changing
chkString(Request.Form("Email"),"SQLString")
to

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

in routine
Beautiful! It works perfectly now! Thank you! bigsmile<
leatherlips
03 May 2008, 09:44


Now I have another question. How can we have paragraph breaks in the welcome message? When I try to do one I get an error at the spot of the break.<
Etymon
03 May 2008, 21:50


Hey leatherlips,

I haven't forgotten about your e-mail question. I've been at appointments all week. I get back to you soon. If I take too long, give me a holler.
Etymon
<
MarkJH
04 May 2008, 05:36


Hmm, I'm now getting this error upon conformation of registration (http://www.bandlink.net/forum/register.asp?actkey=):

Microsoft OLE DB Provider for SQL Server error '80040e10'

No value given for one or more required parameters.

/forum/register.asp, line 388

The line being:
my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords

Is this because I have other MODs involved? I have a timezone adjust MOD and a captcha MOD installed.<
leatherlips
04 May 2008, 09:14


I also have the same anti-spam mod as you do. I do not have the time adjust mod. Did you place the Welcome PM code in the spot indicated by modifichicci? It should come right after the first Call DoCount.<
MarkJH
07 May 2008, 11:59


Yep, put everything where it should go. Well, as far as I can see...
I can post a .txt version of my register.asp, if you'd care to take a look? I'll buy you a beer if you can figure it out! smile<
leatherlips
07 May 2008, 12:01


Post a .txt of your file and I'll see if I can spot anything. I don't drink alcohol but thanks for the offer! smile<
MarkJH
07 May 2008, 13:52


Thanks. smile Here it is. It should be around line 348. Note that I've tried it with chkString(Request.Form("Email"),"SQLString") and chkString(rsKey("M_EMAIL"),"SQLString"). <
leatherlips
07 May 2008, 14:08


It looks like your code is in the correct place. I did notice this at the very beginning of your file:



I'm not sure what that is. My file does not have that.
Are you getting any errors or is it just not sending?<
leatherlips
07 May 2008, 14:11


I also noticed that you have placed some formatting in your welcome message such as: post in the ""Forum/Site Suggestions"" forum.<br><br>. They may cause it to not be working correctly. When I tried adding quotes and breaks it gave me issues. You could try removing those things in your message and see if it works.<
leatherlips
08 May 2008, 15:59


Does this mod require that email is enabled?<
leatherlips
08 May 2008, 19:54


MarkJH, there is another thread with a possible fix for you here: http://forum.snitz.com/forum/topic.asp?TOPIC_ID=67019<
cripto9t
09 May 2008, 08:59


Originally posted by leatherlips
Does this mod require that email is enabled?
From what I could tell looking at the file last night, it depends on where you place the code. Actually to be a complete working mod it needs to be in at least 2 places in the file, maybe more. One could probably write a sub and call it when the conditions are right.<
© 2000-2021 Snitz™ Communications