This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Removes a marketing consent. The consent is cancelled, and the state
is updated to REVOKED
.
The marketing consent entity still exists, but the recipient is no longer eligible to receive commmunication.
To delete a marketing consent entirely, use Delete Marketing Consent.
Required fields:
details.type
.details.email
OR details.phone
.info.lastRevokeActivity
.This function requires elevated permissions and runs only on the backend and on dashboard pages.
function removeMarketingConsent(
details: MarketingConsentDetails,
options: RemoveMarketingConsentOptions,
): Promise<RemoveMarketingConsentResponse>;
Marketing consent communication details.
Field options. The lastRevokeActivity
field must be passed.
import { marketingConsent } from "wix-marketing.v2";
async function removeMarketingConsent(details, options) {
try {
const result = await marketingConsent.removeMarketingConsent(
details,
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.