Manage Email Blocklists
Allow your user to block specific email addresses from being able to send messages to any of their Sudo email addresses
Blocking Email Addresses
Action
Definition
Status
Definition
// Obtain the email addresses to be blocked
const addressesToBlock = [
'email-address-1@domain.com',
'email-address-2@domain.com',
]
let emailAddressId: string | undefined
// Set the emailAddressId if you want to block for just a specific address
emailAddressId = emailAddress.id
let action: BlockedAddressAction | undefined
// Set the action if you want to specify an action.
action = BlockedAddressAction.Spam
try {
const blockingResult = await emailClient.blockEmailAddresses({
addressesToBlock,
emailAddressId,
action,
})
switch (blockingResult.status){
case UpdateEmailMessagesStatus.Success:
// All addresses were blocked successfully
break
case UpdateEmailMessagesStatus.Failed:
// None of the addresses were blocked successfully
break
case UpdateEmailMessagesStatus.Partial:
// `blockingResult.successItems` contains an array of all the addresses
// blocked successfully.
// `blockingResult.failureItems` cotains an array of all the addresses
// that failed to be blocked successfully.
break
}
} catch (e) {
// Handle/notify user of errors
} Unblocking Email Addresses
Listing Blocked Email Addresses
Property
Description
Last updated