USP_FAFEVENT_LOADDEFAULT_EMAILTEMPLATE

Load default email template for request received, approved, declined

Parameters

Parameter Parameter Type Mode Description
@ID uniqueidentifier IN

Definition

Copy


CREATE procedure dbo.USP_FAFEVENT_LOADDEFAULT_EMAILTEMPLATE (@ID UNIQUEIDENTIFIER  = NULL)
as
begin

DECLARE @NAME varchar(100)
DECLARE @GUID UNIQUEIDENTIFIER
DECLARE @DESCRIPTION varchar(250)
DECLARE @CONTENTHTML varchar(5000)
DECLARE @FROMADDRESS varchar(125)
DECLARE @FROMDISPLAYNAME varchar(100)
DECLARE @SUBJECT varchar(250)
DECLARE @REPLYADDRESS varchar(125)
DECLARE @pPKID INTEGER

--1-Add Default Email Template for request received

IF NOT EXISTS (SELECT ID FROM EMAILTEMPLATE (NOLOCK) WHERE Name='Default: FAF Event Request Received Notification')
BEGIN
    SET @pPKID = 0
END
ELSE
BEGIN
    SET @pPKID = (SELECT ID FROM EMAILTEMPLATE (NOLOCK) WHERE Name='Default: FAF Event Request Received Notification')
END

SET @NAME = 'Default: FAF Event Request Received Notification'

SET @GUID = newid()
SET @FROMADDRESS = 'fafeventadmin@blackbaud.com'
SET @FROMDISPLAYNAME = 'FAFEvent Administrator'
SET @REPLYADDRESS = 'fafeventadmin@blackbaud.com'
SET @SUBJECT = 'Thank you for requesting to start a fundraising group'

SET @CONTENTHTML = '<p style="margin: 0px;"><img src="insertField.field?id=300&amp;nmode=0&amp;name=System+date&amp;type=15" style="cursor: move;" title="System date" runat="server" fieldid="300" attribid="0" fieldname="System date" fieldtype="15" htmlencode="True" searchable="0" isloop="False" /></p>  <p style="margin: 0px; height: 16px;">&#160;</p><p style="margin: 0px;">Dear <img src="insertField.field?id=381&amp;nmode=0&amp;name=First+name&amp;type=15" style="cursor: move;" title="First name" runat="server" fieldid="381" attribid="0" fieldname="First name" fieldtype="15" htmlencode="True" searchable="0" isloop="False" /> <img src="insertField.field?id=382&amp;nmode=0&amp;name=Last+name&amp;type=15" style="cursor: move;" title="Last name" runat="server" fieldid="382" attribid="0" fieldname="Last name" fieldtype="15" htmlencode="True" searchable="0" isloop="False" />,</p>  <p style="margin: 0px; height: 16px;">&#160;</p><p style="margin: 0px;">Thank you for registering for the <img src="insertField.field?id=305&amp;nmode=0&amp;name=Event+name&amp;type=15" style="cursor: move;" title="Event name" runat="server" fieldid="305" attribid="0" fieldname="Event name" fieldtype="15" htmlencode="True" searchable="0" isloop="False" />.</p>  <p style="margin: 0px; height: 16px;">&#160;</p><p style="margin: 0px;">We received your request to start the <img src="insertField.field?id=1430&amp;nmode=0&amp;name=Group+name&amp;type=15" style="cursor: move;" title="Group name" runat="server" fieldid="1430" attribid="0" fieldname="Group name" fieldtype="15" htmlencode="True" searchable="0" isloop="False" /> <img src="insertField.field?id=1436&amp;nmode=0&amp;name=Group+type+name&amp;type=15" style="cursor: move;" title="Group type name" runat="server" fieldid="1436" attribid="0" fieldname="Group type name" fieldtype="15" htmlencode="True" searchable="0" isloop="False" />, and you will receive a response via email soon. Your <img src="insertField.field?id=1436&amp;nmode=0&amp;name=Group+type+name&amp;type=15" style="cursor: move;" title="Group type name" runat="server" fieldid="1436" attribid="0" fieldname="Group type name" fieldtype="15" htmlencode="True" searchable="0" isloop="False" /> information appears below.</p>  <p style="margin: 0px; height: 16px;">&#160;</p><p style="margin: 0px;"><strong>Contact Information</strong></p>  <p style="margin: 0px;"><img src="insertField.field?id=381&amp;nmode=0&amp;name=First+name&amp;type=15" style="cursor: move;" title="First name" runat="server" fieldid="381" attribid="0" fieldname="First name" fieldtype="15" htmlencode="True" searchable="0" isloop="False" /> <img src="insertField.field?id=382&amp;nmode=0&amp;name=Last+name&amp;type=15" style="cursor: move;" title="Last name" runat="server" fieldid="382" attribid="0" fieldname="Last name" fieldtype="15" htmlencode="True" searchable="0" isloop="False" /></p><p style="margin: 0px;"><img src="insertField.field?id=391&amp;nmode=0&amp;name=Address&amp;type=15" style="cursor: move;" title="Address" runat="server" fieldid="391" attribid="0" fieldname="Address" fieldtype="15" htmlencode="True" searchable="0" isloop="False" /></p><p style="margin: 0px;"><img src="insertField.field?id=392&amp;nmode=0&amp;name=City&amp;type=15" style="cursor: move;" title="City" runat="server" fieldid="392" attribid="0" fieldname="City" fieldtype="15" htmlencode="True" searchable="0" isloop="False" /> <img src="insertField.field?id=393&amp;nmode=0&amp;name=State%2fProvince&amp;type=15" style="cursor: move;" title="State/Province" runat="server" fieldid="393" attribid="0" fieldname="State/Province" fieldtype="15" htmlencode="True" searchable="0" isloop="False" /> <img src="insertField.field?id=394&amp;nmode=0&amp;name=Postcode&amp;type=15" style="cursor: move;" title="Postcode" runat="server" fieldid="394" attribid="0" fieldname="Postcode" fieldtype="15" htmlencode="True" searchable="0" isloop="False" /></p>  <p style="margin: 0px; height: 16px;">&#160;</p><p style="margin: 0px;"><strong>Registration Information</strong></p>  <p style="margin: 0px;"><img src="insertField.field?id=435&amp;nmode=0&amp;name=Registration+option+detail&amp;type=15" style="cursor: move;" title="Registration option detail" runat="server" fieldid="435" attribid="0" fieldname="Registration option detail" fieldtype="15" htmlencode="False" searchable="0" isloop="False" /></p>  <p style="margin: 0px;">Fundraising group name: <img src="insertField.field?id=1430&amp;nmode=0&amp;name=Group+name&amp;type=15" style="cursor: move;" title="Group name" runat="server" fieldid="1430" attribid="0" fieldname="Group name" fieldtype="15" htmlencode="True" searchable="0" isloop="False" /></p><p style="margin: 0px; height: 16px;">&#160;</p><p style="margin: 0px;">Please visit <img src="insertField.field?id=612&amp;nmode=0&amp;name=Participant+page+URL+with+tracking&amp;type=15" style="cursor: move;" title="Participant page URL with tracking" runat="server" fieldid="612" attribid="0" fieldname="Participant page URL with tracking" fieldtype="15" htmlencode="False" searchable="0" isloop="False" /> to begin your personal fundraising efforts while we consider your request.</p>  <p style="margin: 0px; height: 16px;">&#160;</p><p style="margin: 0px;">Regards,</p>  <p style="margin: 0px; height: 16px;">&#160;</p><p style="margin: 0px;"><img src="insertField.field?id=340&amp;nmode=0&amp;name=Event+contact+name&amp;type=15" style="cursor: move;" title="Event contact name" runat="server" fieldid="340" attribid="0" fieldname="Event contact name" fieldtype="15" htmlencode="True" searchable="0" isloop="False" /></p><p style="margin: 0px;"><img src="insertField.field?id=345&amp;nmode=0&amp;name=Event+contact+email&amp;type=15" style="cursor: move;" title="Event contact email" runat="server" fieldid="345" attribid="0" fieldname="Event contact email" fieldtype="15" htmlencode="False" searchable="0" isloop="False" /></p>'

EXEC  dbo.spAddUpdate_EmailTemplate @PKID = @pPKID
    @UserID = 0,   
    @ClientsID = 0,        
    @Name = @Name,  
    @Description = null,  
    @ContentHTML = @ContentHTML,  
    @RecipientListsXML = null,  
    @ContentText = null,  
    @FromAddress = @FromAddress,  
    @FromDisplayName = @FromDisplayName,  
    @Subject = @Subject,  
    @Priority = 3,  
    @ReplyAddress = @ReplyAddress ,  
    @ReturnReceipt = 0,  
    @ReturnReceiptAddress = null,  
    @ForwardDSN  = 0,  
    @ForwardDSNAddress = null,  
    @GUID = @GUID,  
    @Type = 0,  
    @DataSourceID = 1,  
    @ClientSitesID = 1,
    @AppealID=0;  

--2-Add Default Email Template for request approved

IF NOT EXISTS (SELECT ID FROM EMAILTEMPLATE (NOLOCK) WHERE Name='Default: FAF Event Request Approved Notification')
BEGIN
    SET @pPKID = 0
END
ELSE
BEGIN
    SET @pPKID = (SELECT ID FROM EMAILTEMPLATE (NOLOCK) WHERE Name='Default: FAF Event Request Approved Notification')
END

SET @NAME = 'Default: FAF Event Request Approved Notification'

SET @GUID = newid()
SET @FROMADDRESS = 'fafeventadmin@blackbaud.com'
SET @FROMDISPLAYNAME = 'FAFEvent Administrator'
SET @REPLYADDRESS = 'fafeventadmin@blackbaud.com'
SET @SUBJECT = 'Your request is approved'

SET @CONTENTHTML = '<p style="margin: 0px;"><img src="insertField.field?id=300&amp;nmode=0&amp;name=System+date&amp;type=15" style="cursor: move;" title="System date" runat="server" fieldid="300" attribid="0" fieldname="System date" fieldtype="15" htmlencode="True" searchable="0" isloop="False" /></p><p style="margin: 0px; height: 16px;">&#160;</p><p style="margin: 0px;">Dear <img src="insertField.field?id=381&amp;nmode=0&amp;name=First+name&amp;type=15" style="cursor: move;" title="First name" runat="server" fieldid="381" attribid="0" fieldname="First name" fieldtype="15" htmlencode="True" searchable="0" isloop="False" /> <img src="insertField.field?id=382&amp;nmode=0&amp;name=Last+name&amp;type=15" style="cursor: move;" title="Last name" runat="server" fieldid="382" attribid="0" fieldname="Last name" fieldtype="15" htmlencode="True" searchable="0" isloop="False" />,</p><p style="margin: 0px; height: 16px;">&#160;</p><p style="margin: 0px;">Thank you for registering for the <img src="insertField.field?id=305&amp;nmode=0&amp;name=Event+name&amp;type=15" style="cursor: move;" title="Event name" runat="server" fieldid="305" attribid="0" fieldname="Event name" fieldtype="15" htmlencode="True" searchable="0" isloop="False" />. Your request to start the <img src="insertField.field?id=1430&amp;nmode=0&amp;name=Group+name&amp;type=15" style="cursor: move;" title="Group name" runat="server" fieldid="1430" attribid="0" fieldname="Group name" fieldtype="15" htmlencode="True" searchable="0" isloop="False" /> is approved.</p><p style="margin: 0px; height: 16px;">&#160;</p><p style="margin: 0px;">Please visit <img src="insertField.field?id=1440&amp;nmode=0&amp;name=Group+page+URL+with+tracking&amp;type=15" style="cursor: move;" title="Group page URL with tracking" runat="server" fieldid="1440" attribid="0" fieldname="Group page URL with tracking" fieldtype="15" htmlencode="False" searchable="0" isloop="False" /> to begin recruiting fundraising group members.</p><p style="margin: 0px; height: 16px;">&#160;</p><p style="margin: 0px;">Regards,</p>  <p style="margin: 0px; height: 16px;">&#160;</p><img src="insertField.field?id=340&amp;nmode=0&amp;name=Event+contact+name&amp;type=15" style="cursor: move;" title="Event contact name" runat="server" fieldid="340" attribid="0" fieldname="Event contact name" fieldtype="15" htmlencode="True" searchable="0" isloop="False" /></p>'

EXEC  dbo.spAddUpdate_EmailTemplate @PKID = @pPKID
    @UserID = 0,   
    @ClientsID = 0,        
    @Name = @Name,  
    @Description = null,  
    @ContentHTML = @ContentHTML,  
    @RecipientListsXML = null,  
    @ContentText = null,  
    @FromAddress = @FromAddress,  
    @FromDisplayName = @FromDisplayName,  
    @Subject = @Subject,  
    @Priority = 3,  
    @ReplyAddress = @ReplyAddress ,  
    @ReturnReceipt = 0,  
    @ReturnReceiptAddress = null,  
    @ForwardDSN  = 0,  
    @ForwardDSNAddress = null,  
    @GUID = @GUID,  
    @Type = 0,  
    @DataSourceID = 1,  
    @ClientSitesID = 1,
    @AppealID=0;  

--3-Add Default Email Template for request declined

IF NOT EXISTS (SELECT ID FROM EMAILTEMPLATE (NOLOCK) WHERE Name='Default: FAF Event Request Declined Notification')
BEGIN
    SET @pPKID = 0
END
ELSE
BEGIN
    SET @pPKID = (SELECT ID FROM EMAILTEMPLATE (NOLOCK) WHERE Name='Default: FAF Event Request Declined Notification')
END

SET @NAME = 'Default: FAF Event Request Declined Notification'

SET @GUID = newid()
SET @FROMADDRESS = 'fafeventadmin@blackbaud.com'
SET @FROMDISPLAYNAME = 'FAFEvent Administrator'
SET @REPLYADDRESS = 'fafeventadmin@blackbaud.com'
SET @SUBJECT = 'Thank you for requesting to start a fundraising group'
SET @SUBJECT = 'Your request is declined'

SET @CONTENTHTML = '<p style="margin: 0px;"><img src="insertField.field?id=300&amp;nmode=0&amp;name=System+date&amp;type=15" style="cursor: move;" title="System date" runat="server" fieldid="300" attribid="0" fieldname="System date" fieldtype="15" htmlencode="True" searchable="0" isloop="False" /></p><p style="margin: 0px; height: 16px;">&#160;</p><p style="margin: 0px;">Dear <img src="insertField.field?id=381&amp;nmode=0&amp;name=First+name&amp;type=15" style="cursor: move;" title="First name" runat="server" fieldid="381" attribid="0" fieldname="First name" fieldtype="15" htmlencode="True" searchable="0" isloop="False" /><img src="insertField.field?id=382&amp;nmode=0&amp;name=Last+name&amp;type=15" style="cursor: move;" title="Last name" runat="server" fieldid="382" attribid="0" fieldname="Last name" fieldtype="15" htmlencode="True" searchable="0" isloop="False" />,</p>  <p style="margin: 0px; height: 16px;">&#160;</p><p style="margin: 0px;">Thank you for requesting to start the <img src="insertField.field?id=1430&amp;nmode=0&amp;name=Group+name&amp;type=15" style="cursor: move;" title="Group name" runat="server" fieldid="1430" attribid="0" fieldname="Group name" fieldtype="15" htmlencode="True" searchable="0" isloop="False" />. We regret to inform you the request is declined because, according to our records, you do not yet meet the requirements to lead a team.</p>  <p style="margin: 0px; height: 16px;">&#160;</p><p style="margin: 0px;">Your current fundraising role is individual fundraiser. If you would like to be registered in a different fundraising role, please email <img src="insertField.field?id=340&amp;nmode=0&amp;name=Event+contact+name&amp;type=15" style="cursor: move;" title="Event contact name" runat="server" fieldid="340" attribid="0" fieldname="Event contact name" fieldtype="15" htmlencode="True" searchable="0" isloop="False" /> at <img src="insertField.field?id=345&amp;nmode=0&amp;name=Event+contact+email&amp;type=15" style="cursor: move;" title="Event contact email" runat="server" fieldid="345" attribid="0" fieldname="Event contact email" fieldtype="15" htmlencode="False" searchable="0" isloop="False" /></p><p style="margin: 0px; height: 16px;">&#160;</p><p style="margin: 0px;">Please call <img src="insertField.field?id=355&amp;nmode=0&amp;name=Event+support+phone&amp;type=15" style="cursor: move;" title="Event support phone" runat="server" fieldid="355" attribid="0" fieldname="Event support phone" fieldtype="15" htmlencode="True" searchable="0" isloop="False" />, or visit&#160;<img src="insertField.field?id=365&amp;nmode=0&amp;name=Event+support+URL&amp;type=15" style="cursor: move;" title="Event support URL" runat="server" fieldid="365" attribid="0" fieldname="Event support URL" fieldtype="15" htmlencode="False" searchable="0" isloop="False" /> if we can provide further assistance.</p><p style="margin: 0px; height: 16px;">&#160;</p><p style="margin: 0px;">Thank you for supporting the <img src="insertField.field?id=305&amp;nmode=0&amp;name=Event+name&amp;type=15" style="cursor: move;" title="Event name" runat="server" fieldid="305" attribid="0" fieldname="Event name" fieldtype="15" htmlencode="True" searchable="0" isloop="False" />.</p><p style="margin: 0px; height: 16px;">&#160;</p><p style="margin: 0px;">Regards,</p>  <p style="margin: 0px;"><br /><img src="insertField.field?id=340&amp;nmode=0&amp;name=Event+contact+name&amp;type=15" style="cursor: move;" title="Event contact name" runat="server" fieldid="340" attribid="0" fieldname="Event contact name" fieldtype="15" htmlencode="True" searchable="0" isloop="False" /></p>'

EXEC  dbo.spAddUpdate_EmailTemplate @PKID = @pPKID
    @UserID = 0,   
    @ClientsID = 0,        
    @Name = @Name,  
    @Description = null,  
    @ContentHTML = @ContentHTML,  
    @RecipientListsXML = null,  
    @ContentText = null,  
    @FromAddress = @FromAddress,  
    @FromDisplayName = @FromDisplayName,  
    @Subject = @Subject,  
    @Priority = 3,  
    @ReplyAddress = @ReplyAddress ,  
    @ReturnReceipt = 0,  
    @ReturnReceiptAddress = null,  
    @ForwardDSN  = 0,  
    @ForwardDSNAddress = null,  
    @GUID = @GUID,  
    @Type = 0,  
    @DataSourceID = 1,  
    @ClientSitesID = 1,
    @AppealID=0;  

end