fn_Get_Reply_Text returns a substring preceeding a hash key in e-mail body.


This function searches a given string (i.e. e-mail body) for a hash expressed by 3 input keys should they be known. If a hash can not be found an entire string to search is returned, otherwise the substring prceeding a hash is returned. This can be helpfull to tear off reply text in an incoming e-mail which resulted from an earlier e-mail job and such earlier job was identified. This function is a wrapper to fn_Get_Text_Before_Token.

[important]Note: The function only returns top 8000 characters of a result string[/important]


[set @s = ] dbo.fn_Get_Reply_Text ( @body, @key1, @key2, @key3 )


Column Name Data Type Direction Default Status
@text text in string to search (typically an e-mail body) Required
@key1 uniqueidentifier in key 1 Required
@key2 uniqueidentifier in key 2 Required
@key3 uniqueidentifier in key 3 Required

Return Values

returns varchar(8000)


Extract reply portion from a body of an incoming e-mail using known original e-mail job keys.

declare @Key1 uniqueidentifier, @Key3 uniqueidentifier, @Key3 uniqueidentifier, 
@reply varchar(8000), @rKey uniqueidentifier
/* .... some code ... */
select	@reply	= dbo.fn_Get_Reply_Text(Body,@Key1,@Key2,@Key3) 
from IN_EMAIL where rKey=@rKey
/* .... some code ... */

See Also

Database Tables
Getting Started