putSuppressedDestination method

Future<void> putSuppressedDestination({
  1. required String emailAddress,
  2. required SuppressionListReason reason,
  3. String? tenantName,
})

Adds an email address to the suppression list for your account or for a specific tenant. To target a tenant's suppression list, specify the TenantName parameter. If you omit TenantName, the address is added to the account-level suppression list.

May throw BadRequestException. May throw NotFoundException. May throw TooManyRequestsException.

Parameter emailAddress : The email address that should be added to the suppression list for your account or for the specified tenant.

Parameter reason : The factors that should cause the email address to be added to the suppression list for your account or for the specified tenant.

Parameter tenantName : The name of the tenant whose suppression list you want to add the address to. If you omit this parameter, the address is added to the account-level suppression list.

Implementation

Future<void> putSuppressedDestination({
  required String emailAddress,
  required SuppressionListReason reason,
  String? tenantName,
}) async {
  final $payload = <String, dynamic>{
    'EmailAddress': emailAddress,
    'Reason': reason.value,
    if (tenantName != null) 'TenantName': tenantName,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri: '/v2/email/suppression/addresses',
    exceptionFnMap: _exceptionFns,
  );
}