Email with the full text of a new post

Snitz™ Forums 2000
https://forum.snitz.com/forumTopic/Posts/63238?pagenum=1
05 November 2025, 02:34

Topic


ale34
Email with the full text of a new post
08 November 2006, 07:24


Hi,
my forum members are asking me for having by email the full text of a new post (forum subscription) instead of receiving a message with the link. Is it possible?
Thank you for your help

Alex<

 

Replies ...


JJenson
08 November 2006, 09:53


I am guessing you are looking for the rss feed mod and you can find it on snitzbitz.com<
ale34
08 November 2006, 10:05


Hi Jeff,
I have already seen the rss mod but I think it does too much work for what I need smile I would like just to receive in the notification sent by email to subscribed members: the post (full text) + the link where to follow the discussion.
The forum members asking me for that, seem too busy or are receiving too many emails and they consider a waste of time to follow a link instead of having the content of the new post in their mail.
I think that someone must have already implemented this function, don't you think so?<
JJenson
08 November 2006, 11:11


It is possible that someone has. I am not aware of anything but the rss feed but again I am not all knowledgable like most people on here. I only share the minimal things I have learned. lol

Good luck and I am sure shaggy knows he seems to know everything.
<
Shaggy
08 November 2006, 11:35


... well, if you insist ...
Find the following on line 45 of inc_subscription.asp
Code:
	StrSql = "SELECT C.CAT_SUBSCRIPTION, C.CAT_NAME, F.F_SUBJECT, F.F_SUBSCRIPTION, " & _
" T.T_SUBJECT, M.M_NAME " & _
" FROM " & strTablePrefix & "CATEGORY C, " & _
" " & strTablePrefix & "FORUM F, " & _
" " & strTablePrefix & "TOPICS T, " & _
" " & strMemberTablePrefix & "MEMBERS M " & _
" WHERE C.CAT_ID = " & CatID & " AND F.FORUM_ID = " & ForumID & _
" AND T.TOPIC_ID = " & TopicID & " AND M.MEMBER_ID = " & pMemberID
And replace it with the following:
Code:
	StrSql = "SELECT C.CAT_SUBSCRIPTION, C.CAT_NAME, F.F_SUBJECT, F.F_SUBSCRIPTION, " & _
" T.T_SUBJECT, T.T_MESSAGE, M.M_NAME " & _
" FROM " & strTablePrefix & "CATEGORY C, " & _
" " & strTablePrefix & "FORUM F, " & _
" " & strTablePrefix & "TOPICS T, " & _
" " & strMemberTablePrefix & "MEMBERS M " & _
" WHERE C.CAT_ID = " & CatID & " AND F.FORUM_ID = " & ForumID & _
" AND T.TOPIC_ID = " & TopicID & " AND M.MEMBER_ID = " & pMemberID
Find the following on line 69:
Code:
	CatSubscription   = allSubsData(0, 0)
CatName = allSubsData(1, 0)
ForumName = allSubsData(2, 0)
ForumSubscription = allSubsData(3, 0)
TopicName = allSubsData(4, 0)
MemberName = allSubsData(5, 0)
And replace it with the following:
Code:
	CatSubscription   = allSubsData(0, 0)
CatName = allSubsData(1, 0)
ForumName = allSubsData(2, 0)
ForumSubscription = allSubsData(3, 0)
TopicName = allSubsData(4, 0) TopicContent = allSubsData(5, 0) MemberName = allSubsData(6, 0)
Finally, you'll need to edit the following two lines on line 187 to customise the message that gets sent to suit your needs:
Code:
				strMessage = strMessage & "Regarding the subject - " & TopicName & "." & vbNewline & vbNewline
strMessage = strMessage & "You can view the posting at " & strForumURL & "topic.asp?whichpage=-1&TOPIC_ID=" & TopicId & vbNewline
You will need to pass the TopicContent vriable through the FormatStr function so that all the forum code is parsed. I would, however, highly recommend that you then pass it through a custom function to strip out all the HTML for those whose e-mail clients cannot read HTML mails or may not display it correctly.
<
ale34
08 November 2006, 11:47


Ooops, Shaggy was there!! I am trying this and in 10 minutes I will let you know...
The only thing I need to understand is this part of your post:

You will need to pass the TopicContent vriable through the FormatStr function so that all the forum code is parsed. I would, however, highly recommend that you then pass it through a custom function to strip out all the HTML for those whose e-mail clients cannot read HTML mails or may not display it correctly.
Could you explain to me how to pass the TopicContent through the FormatStr function, please?<
JJenson
08 November 2006, 11:55


Shaggy I just want to say your my hero lol. Well as far as snitz support goes lol wink<
Shaggy
08 November 2006, 12:00


Could you explain to me how to pass the TopicContent through the FormatStr function, please?
When inserting TopicContent in your message do so like so:

strMessage="dooby-doobby "&FormatStr(TopicContent)&" blah-de-blah"
<
ale34
08 November 2006, 12:21


Unfortunetly it does not work as I wish.
It sends by email the text of the first topic (the oldest one)
but not the reply to the topic being posted (the new one). What am I doing wrong?<
Shaggy
08 November 2006, 12:42


Ah, yes, of course it would blush Sorry, winding down from a long day with a 0600 start wink
Lemme sleep on it & I'll get back to you tomorrow.
<
ale34
08 November 2006, 12:51


Ok Shaggy,
I hope you will have a good fruitful night wink<
TonyB7
08 November 2006, 21:38


Keep in mind the behavior you're describing is more the behavior of a mailing list, not a web forum. Next you'll be wanting a mod that lets them reply via email. Then they'll never have to visit and you'll know you should just be running a listserv.<
muzishun
09 November 2006, 00:23


One other thing to bear in mind is that if your forum starts to become more heavily trafficked, you'll have serious issues with bandwidth. Subscriptions have the potential (on a busy forum) to bog the server down considerably. That's why, for example, subscriptions are turned off here, as well as at some of the busier Snitzes out there.
If you're on a dedicated server or if you are running a forum that you don't anticipate getting terribly big, this shouldn't be an issue.<
Shaggy
09 November 2006, 03:56


OK, you're going to need an extra database hit and this ain't exactly the "prettiest" solution but it will serve your purposes. On top of the changes I've already posted, find the following on line 172:
Code:
if LoopTopicID > 0 then
strSubject = strForumTitle & " - Reply to a posting"
strMessage = strMessage & MemberName & " has replied to a topic on " & strForumTitle & " that you requested notification to. "
else
And replace it with the following:
Code:
if LoopTopicID > 0 then
strSubject = strForumTitle & " - Reply to a posting"
strMessage = strMessage & MemberName & " has replied to a topic on " & strForumTitle & " that you requested notification to. " set rsReply=my_Conn.execute(TopSQL("SELECT R_MESSAGE FROM REPLY WHERE TOPIC_ID="&TopicID&" AND R_STATUS=1 ORDER BY REPLY_ID DESC",1))
if not rsReply.eof then TopicContent=rs("R_MESSAGE")
rsReply.close:set rsReply=nothing
else
<edited by="Shaggy" to="correct typo" />
<
ale34
09 November 2006, 07:52


Thank you Shaggy. but there is something wrong: here below the error I got

Erreur de compilation Microsoft VBScript erreur '800a0400'
Instruction attendue
/forum/inc_subscription.asp, ligne 197
end if
^
<
Shaggy
09 November 2006, 07:57


Did you replace that entire if statement with what I posted above? You should only have replaced the first part of it. Can you post a link to a *.txt copy of your inc_subscription.asp if that's not the problem?
<
ale34
09 November 2006, 08:05


<edit by="Shaggy">Please post a link to a *.txt copy of you file, as requested, rather than posting the entire contents of a file here</edit><
ale34
09 November 2006, 08:11


Sorry, I did not understand blush <
Shaggy
09 November 2006, 08:16


Save a copy of the file with a *.txt extension rather than *.asp, upload it to your server and post the link here.
<
ale34
09 November 2006, 08:17


http://.........../inc_subscription.txt<
Shaggy
09 November 2006, 08:46


You're missing the following line from your file, immediately before the changes I provided:

if LoopForumID > 0 then
You're also missing the corrections I made to the code earlier; you must've been editing as I was correcting.
<
ale34
09 November 2006, 08:49


Ooops,
I will chek... Tank you! I edited the link for security resaon if you do not mind....<
ale34
09 November 2006, 19:31


Ok it is done!
Thank you.. <
Shaggy
10 November 2006, 03:59


You're welcome smile
<
sokkmonkey
25 October 2007, 14:01


okay.. I tried this, the new read message is changed ok but it's still not showing the message body copy-
where did I go wrong? http://www.rattlebrain.com/~sokkmonkey/inc_subscription.txt

Likewise if I was to add the following to strip the HTML and netcode, where would be a good place to stick it?
Function StripCode(ByVal fString)
if fString = "" or IsNull(fString) then
fString = " empty string test"
elseif strAllowForumCode = "1" then
'filter out forumcode
fStringLeft = ""
fFound = False
Do While InStr(fString, "[")
fFound = True
fStringLeft = fStringLeft & " " & Left(fString, InStr(fString, "[")-1)
fString = MID(fString, InStr(fString, "]") + 1)
Loop
StripCode = fStringLeft & fString
If Not fFound Then StripCode = fString
elseif strAllowHTML = "1" then
' filter out html code

fStringLeft = ""
fFound = False
Do While InStr(fString, "<")
fFound = True
fStringLeft = fStringLeft & " " & Left(fString, InStr(fString, "<")-1)
fString = MID(fString, InStr(fString, ">") + 1)
Loop
StripCode = fStringLeft & fString
If Not fFound Then StripCode = fString
end if
if strBadWordFilter = "1" then
fString = ChkBadWords(fString)
end if
StripCode = fString
End Function<
davidm
05 September 2008, 12:09


I've followed these instructions and have created my email message like this:

strMessage = strMessage & MemberName & " has posted the following to the forum '" & ForumName & "' on the " & strForumTitle & ". " & vbNewLine & vbNewLine

strMessage = strMessage & "The subject was " & TopicName & vbNewLine & vbNewLine

strMessage = strMessage & " and the message reads: " &FormatStr(TopicContent) & ". " & vbNewLine & vbNewLine

The odd thing is despite the vbNewLines, I'm just getting the message all strung together in one line. How can I force a new line between the different blocks to make it all more readable? <
Carefree
05 September 2008, 14:42


If all you want is to break-up the various replies, that shouldn't be too difficult. The following modification should give you a blank line between replies.
Change this line:
strSubject = strForumTitle & " - Reply to a posting"

to say:
strSubject = "<br><br>" & strForumTitle & " - Reply to a posting"<
flhtci01
03 October 2008, 17:17


OK, I have no experience at this but am giving it a shot.
I have read this thread and trying to get this to work. The one thing I am trying to change is delete the link to the message and replace it with a message to log onto the forum to reply. (The link doesn't work due to the way the website security is set up.) (Long story)

Anyway I got the following error
Microsoft VBScript compilation error '800a0401'

Expected end of statement

/Members/Patrol_Reps_Forum/patrepbb/inc_subscription.asp, line 189

strMessage = strMessage & "You can view the posting by logging onto the Patrol Reps Forum " vbNewline
--------------------------------------------------------------------------------------------^

Can someone help me?<
HuwR
03 October 2008, 18:02


you need an & after the string and before the vbNewline, like so

strMessage = strMessage & "You can view the posting by logging onto the Patrol Reps Forum " & vbNewline<
flhtci01
03 October 2008, 18:34


Thanks for the help on the syntax.
I now seeing the first message of the string in the email but that is all.
Also where is a good place to put the code to strip the html?

I have moved the file to http://www.southernregionnsp.org/inc_subscription.txt
<
© 2000-2021 Snitz™ Communications