spCloneSite_EmailTemplate
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@TargetClientSitesID | int | IN | |
@CurrentUserID | int | IN | |
@CopyBatchGUID | uniqueidentifier | IN | |
@IDs | xml | IN |
Definition
Copy
CREATE procedure dbo.spCloneSite_EmailTemplate
(
@TargetClientSitesID int,
@CurrentUserID int,
@CopyBatchGUID uniqueidentifier,
@IDs xml
)
as
begin
INSERT INTO dbo.EmailTemplate
(ClientsID, Name, Description, OwnerID, Deleted, Guid, ContentHTML, ContentText, FromAddress, FromDisplayName, Subject, Priority, ReplyAddress, ReturnReceipt, ReturnReceiptAddress, ForwardDSN, ForwardDSNAddress, Type, IsInternalUse, DataSourceID, ClientSitesID, CopySourceID, CopyBatchGUID, AppealID, EXPORTDEFINITIONID)
select
ClientsID,
Name,
Description,
OwnerID,
Deleted,
NEWID(),
dbo.UFN_UPDATECOPYCONTENTHTML(ContentHTML, @CopyBatchGuid),
ContentText,
FromAddress,
FromDisplayName,
Subject,
Priority,
ReplyAddress,
ReturnReceipt,
ReturnReceiptAddress,
ForwardDSN,
ForwardDSNAddress,
Type,
IsInternalUse,
DataSourceID,
@TargetClientSitesID,
EmailTemplate.ID,
@CopyBatchGuid,
AppealID,
EXPORTDEFINITIONID
from dbo.EmailTemplate (NOLOCK)
inner join @IDs.nodes('row') as t(Node) on Node.query('ID/text()').value('.', 'int') = EmailTemplate.ID
end