spNetGroup_PopulateGroupNotificationRecipients

Parameters

Parameter Parameter Type Mode Description
@EmailID int IN
@NetGroupID int IN
@NotificationID int IN

Definition

Copy


        CREATE PROCEDURE [dbo].[spNetGroup_PopulateGroupNotificationRecipients]
        (
        @EmailID int,
        @NetGroupID int,
        @NotificationID int
        )
        AS
        BEGIN
            INSERT INTO
            dbo.Email_Recipient
            (
                [EmailID],
                [UserID], 
                [DisplayName], 
                [EmailAddress]
            ) 
            (SELECT
            @EmailID as 'EmailID',
            na.ClientUsersID as 'UserId'
            na.DisplayName as 'DisplayName'
            na.EmailAddress as 'EmailAddress' 
            FROM [NetAccount] na
            INNER JOIN [NetGroupRelation] ngr on na.ID = ngr.NetAccountID and ngr.NetGroupID = @NetGroupID
            INNER JOIN [NotificationSubscription] ns on ns.UserID=na.ClientUsersID and ns.NotificationID = @NotificationID
            WHERE isnull(ngr.BlockedID, 0) = 0
            and na.Deleted = 0 AND na.LockedOut = 0
            )
        END