associateEmailAddressAlias method
Associates an email address alias with an existing email address in an Connect Customer instance. This creates a forwarding relationship where emails sent to the alias email address are automatically forwarded to the primary email address.
Use cases
Following are common uses cases for this API:
- Unified customer support: Create multiple entry points (for example, support@example.com, help@example.com, customercare@example.com) that all forward to a single agent queue for streamlined management.
- Department consolidation: Forward emails from legacy department addresses (for example, sales@example.com, info@example.com) to a centralized customer service email during organizational restructuring.
- Brand management: Enable you to use familiar brand-specific email addresses that forward to the appropriate Connect Customer instance email address.
- Each email address can have a maximum of one alias. You cannot create multiple aliases for the same email address.
- If the alias email address already receives direct emails, it continues to receive direct emails plus forwarded emails.
- You cannot chain email aliases together (that is, create an alias of an alias).
AssociateEmailAddressAlias does not return the following
information:
- A confirmation of the alias relationship details (you must call DescribeEmailAddress to verify).
- The timestamp of when the association occurred.
- The status of the forwarding configuration.
Related operations
- DisassociateEmailAddressAlias: Removes the alias association between two email addresses in an Connect Customer instance.
- DescribeEmailAddress: View current alias configurations for an email address.
- SearchEmailAddresses: Find email addresses and their alias relationships across an instance.
- CreateEmailAddress: Create new email addresses that can participate in alias relationships.
- DeleteEmailAddress: Remove email addresses (automatically removes any alias relationships).
- UpdateEmailAddressMetadata: Modify email address properties (does not affect alias relationships).
May throw AccessDeniedException.
May throw IdempotencyException.
May throw InternalServiceException.
May throw InvalidParameterException.
May throw InvalidRequestException.
May throw ResourceConflictException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
Parameter aliasConfiguration :
Configuration object that specifies which email address will serve as the
alias. The specified email address must already exist in the Connect
Customer instance and cannot already be configured as an alias or have an
alias of its own.
Parameter emailAddressId :
The identifier of the email address.
Parameter instanceId :
The identifier of the Connect Customer instance. You can find
the instance ID in the Amazon Resource Name (ARN) of the instance.
Parameter clientToken :
A unique, case-sensitive identifier that you provide to ensure the
idempotency of the request. If not provided, the Amazon Web Services SDK
populates this field. For more information about idempotency, see Making
retries safe with idempotent APIs.
Implementation
Future<void> associateEmailAddressAlias({
required AliasConfiguration aliasConfiguration,
required String emailAddressId,
required String instanceId,
String? clientToken,
}) async {
final $payload = <String, dynamic>{
'AliasConfiguration': aliasConfiguration,
'ClientToken': clientToken ?? _s.generateIdempotencyToken(),
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri:
'/email-addresses/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(emailAddressId)}/associate-alias',
exceptionFnMap: _exceptionFns,
);
}