31 August 2006

How To Add A Disclaimer To Outgoing Emails In Community Server 2.1 (CS 2.1)

To modify outgoing emails in Community Server 2.1 (CS 2.1), alter the stored procedure: [dbo].cs_Emails_Enqueue and adding the following lines of code:


 /**
 After this you see the word NULL. This is in the position of the insert offset.
 When it is NULL it tells SQL Server to append the new characters to the end of all the characters
 currently in the text column. If the value is 0 then SQL Server will insert the new characters
 before all the characters currently in the text column. If you specify a number then it will count
 from the first character to the number specified and insert the new characters after the one found at
 that point.

 UPDATETEXT #TestTable.ColText @ptrColText 0 0 @BODY
    
 UPDATETEXT #TestTable.ColText @ptrColText NULL 0 @BODY
 **/

    
 --START A HTML FORMATTED EMAIL
 DECLARE @ptrColText VARBINARY(16)
 DECLARE @CommentText nvarchar(1024)

 SET @CommentText = ' <html><body><hr align="left" color="black" width="50%" />'
 SET @CommentText = @CommentText + ' <a href="http://www.kdkeys.net"><font color="black"><strong>We reserve the right to reject any comment posted on this site.</strong></font></a><p></p>'
 SELECT @ptrColText = TEXTPTR(EmailBody) FROM cs_EmailQueue

 UPDATETEXT cs_EmailQueue.EmailBody @ptrColText 0 12 @CommentText

 --END A HTML FORMATTED EMAIL

Comments

No Comments
Anonymous comments are disabled