USP_DATAFORMTEMPLATE_SAVE_REMINDERLETTER
This procedure saves the communication letters associated with reminders.
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@REMINDEROPTIONID | uniqueidentifier | IN | |
@CURRENTAPPUSERID | uniqueidentifier | IN | |
@CHANGEAGENTID | uniqueidentifier | IN | |
@MAILEXPORTDEFINITIONID | uniqueidentifier | IN | |
@EMAILEXPORTDEFINITIONID | uniqueidentifier | IN | |
@LETTERS | xml | IN |
Definition
Copy
CREATE procedure dbo.USP_DATAFORMTEMPLATE_SAVE_REMINDERLETTER(
@REMINDEROPTIONID uniqueidentifier,
@CURRENTAPPUSERID uniqueidentifier,
@CHANGEAGENTID uniqueidentifier = null,
@MAILEXPORTDEFINITIONID uniqueidentifier = null,
@EMAILEXPORTDEFINITIONID uniqueidentifier = null,
@LETTERS xml = null
)
as
begin
declare @CURRENTDATE datetime = getDate();
declare @ACTIVE bit = 0;
if @CHANGEAGENTID is null
exec dbo.USP_CHANGEAGENT_GETORCREATECHANGEAGENT @CHANGEAGENTID output;
select
@ACTIVE = ACTIVE
from
dbo.MKTSEGMENTATION
where
ID = @REMINDEROPTIONID;
-- Rollback active mailings before you can update move segmentation segments around
if @ACTIVE = 1 or dbo.UFN_MKTSEGMENTATION_HASACTIVESEGMENTS(@REMINDEROPTIONID) = 1
exec dbo.USP_MKTSEGMENTATIONACTIVATE_ROLLBACK @REMINDEROPTIONID, @CHANGEAGENTID, 1, 1;
update dbo.REMINDEROPTION set
EXPORTDEFINITIONID = @MAILEXPORTDEFINITIONID,
CHANGEDBYID = @CHANGEAGENTID,
DATECHANGED = @CURRENTDATE
where
ID = @REMINDEROPTIONID;
exec dbo.USP_COMMUNICATIONS_CREATEORUPDATE_LETTERS @REMINDEROPTIONID, @CURRENTAPPUSERID, @CHANGEAGENTID, 4, @MAILEXPORTDEFINITIONID, @EMAILEXPORTDEFINITIONID, @LETTERS;
end