With InstantForum 2016 or above users can now opt-out of forum or topic subscription email notifications via a unique link included within each email notification.
If your upgrading from an earlier version of InstantForum and which to allow your existing users to take advantage of the new one-click email opt-out you'll need to add a random GUID to the new database column added to the subscription tables within the InstantForum 2016 update.
The TSQL Code
The below TSQL script will loop through all your subscriptions within both the forum subscriptions and topic subscription tables and will ad a random identifier to each row enabling 1 click email opt-out,
You'll need to connect to your InstantForum 2016 or above database and execute the TSQL below.
-- add a random GUID to forum subscriptions table ensuring
-- support for one click out-out of forum subscription emails
DECLARE @intForumSubscriptionID int
DECLARE MSGCURSOR CURSOR FOR
SELECT ForumSubscriptionID FROM InstantForum_ForumSubscriptions
OPEN MSGCURSOR
FETCH NEXT FROM MSGCURSOR
INTO @intForumSubscriptionID
WHILE @@FETCH_STATUS = 0
BEGIN
DECLARE @strSubscriptionGuid nvarchar(100)
SEt @strSubscriptionGuid = CONVERT(varchar(100), NEWID())
UPDATE InstantForum_ForumSubscriptions SET
SubscriptionGuid = @strSubscriptionGuid
WHERE ForumSubscriptionID = @intForumSubscriptionID
FETCH NEXT FROM MSGCURSOR
INTO @intForumSubscriptionID
END
-- tidy cursor
CLOSE MSGCURSOR
DEALLOCATE MSGCURSOR
GO
-- add a random GUID to forum subscriptions table ensuring
-- support for one click out-out of forum subscription emails
DECLARE @intTopicSubscriptionID int
DECLARE MSGCURSOR CURSOR FOR
SELECT TopicSubscriptionID FROM InstantForum_TopicSubscriptions
OPEN MSGCURSOR
FETCH NEXT FROM MSGCURSOR
INTO @intTopicSubscriptionID
WHILE @@FETCH_STATUS = 0
BEGIN
DECLARE @strSubscriptionGuid nvarchar(100)
SEt @strSubscriptionGuid = CONVERT(varchar(100), NEWID())
UPDATE InstantForum_TopicSubscriptions SET
SubscriptionGuid = @strSubscriptionGuid
WHERE TopicSubscriptionID = @intTopicSubscriptionID
FETCH NEXT FROM MSGCURSOR
INTO @intTopicSubscriptionID
END
-- tidy cursor
CLOSE MSGCURSOR
DEALLOCATE MSGCURSOR
GO
After you've executed the above script against your InstantForum 2016 or above database new subscription email notifications will contain the one-click opt-out link.
Any new subscriptions after upgrading to InstantForum 2016 will automatically use the one-click opt-out approach.