This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Subscribes a contact to a specific forum category.
By default a contact isn't subscribed to any forum categories.
By subscribing a contact to a category, the contact receives notifications for that category.
If contactId
is not provided, it is implicitly resolved from the caller's context.
This function requires elevated permissions and runs only on the backend and on dashboard pages.
function subscribeContactToCategory(
categoryId: string,
options: SubscribeContactToCategoryOptions,
): Promise<void>;
Category ID.
Options for subscribing the contact.
import { categories } from "wix-forum.v2";
async function subscribeContactToCategory(categoryId, options) {
try {
const result = await categories.subscribeContactToCategory(
categoryId,
options,
);
return result;
} catch (error) {
console.error(error);
// Handle the error
}
}
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.