Search.../

unsubscribeContactFromCategory( )

Developer Preview

Unsubscribes a contact from a specific forum category.

Description

By default a contact isn't subscribed to any forum categories.

By unsubscribing a contact from a category, the contact won’t receive notifications for that category.

If contactId is not provided, it is implicitly resolved from the caller's context.

Admin Method

This function requires elevated permissions to run. This function is not universal and runs only on the backend.

Syntax

function unsubscribeContactFromCategory(categoryId: string, options: UnsubscribeContactFromCategoryOptions): Promise<void>

unsubscribeContactFromCategory Parameters

NAME
TYPE
DESCRIPTION
categoryId
string

Category ID.

options
Optional
UnsubscribeContactFromCategoryOptions

Options for unsubscribing the contact.

Returns

Return Type:

Promise<
void
>

Was this helpful?

unsubscribeContactFromCategory example

Copy Code
1import { categories } from '@wix/wix-forum.v2';
2
3 async function unsubscribeContactFromCategory(categoryId, options) {
4 try {
5 const result = await categories.unsubscribeContactFromCategory(categoryId, options);
6
7 return result;
8 } catch (error) {
9 console.error(error);
10 // Handle the error
11 }
12 }
13