Skip to content

Delete method 🚫 Suppressions

Deletes suppression entry associated with the account based on the specified recipient and source.

Usage

ts
import { MailChannelsClient, Suppressions } from 'mailchannels-sdk'

const mailchannels = new MailChannelsClient('your-api-key')
const suppressions = new Suppressions(mailchannels)

const { success, error } = await suppressions.delete("name@example.com", "api")
ts
import { MailChannels } from 'mailchannels-sdk'

const mailchannels = new MailChannels('your-api-key')

const { success, error } = await mailchannels.suppressions.delete("name@example.com", "api")

Params

  • recipient string required: The email address of the suppression entry to delete.
  • source "api" | "unsubscribe_link" | "list_unsubscribe" | "hard_bounce" | "spam_complaint" | "all" optional: Optional. The source of the suppression entry to be deleted. If source is not provided, it defaults to api. If source is set to all, all suppression entries related to the specified recipient will be deleted.

    NOTE

    Possible values are: api, unsubscribe_link, list_unsubscribe, hard_bounce, spam_complaint, all

Response

  • success boolean guaranteed: Whether the operation was successful.
  • error ErrorResponse | null nullable: Error information if the operation failed.
    • message string guaranteed: A human-readable description of the error.
    • statusCode number | null nullable: The HTTP status code from the API, or null if the error is not related to an HTTP request. This field is intended for diagnostic use only and should not be relied upon.
    • type string guaranteed: A string identifier for the type of error. This field is intended for diagnostic use only and should not be relied upon.

Type declarations

Signature

ts
async function delete (recipient: string, source?: SuppressionsSource): Promise<SuccessResponse>

Response type declarations

ts
interface ErrorResponse {
  message: string;
  statusCode: number | null;
  type: ErrorType;
}
ts
interface SuccessResponse {
  success: boolean;
  error: ErrorResponse | null;
}

Delete type declarations

ts
type SuppressionsSource = "api" | "unsubscribe_link" | "list_unsubscribe" | "hard_bounce" | "spam_complaint" | "all";

Source

SourcePlaygroundDocsTests

Released under the MIT License.