createEmailIdentity method

Future<CreateEmailIdentityResponse> createEmailIdentity({
  1. required String emailIdentity,
  2. List<Tag>? tags,
})

Verifies an email identity for use with Amazon Pinpoint. In Amazon Pinpoint, an identity is an email address or domain that you use when you send email. Before you can use an identity to send email with Amazon Pinpoint, you first have to verify it. By verifying an address, you demonstrate that you're the owner of the address, and that you've given Amazon Pinpoint permission to send email from the address.

When you verify an email address, Amazon Pinpoint sends an email to the address. Your email address is verified as soon as you follow the link in the verification email.

When you verify a domain, this operation provides a set of DKIM tokens, which you can convert into CNAME tokens. You add these CNAME tokens to the DNS configuration for your domain. Your domain is verified when Amazon Pinpoint detects these records in the DNS configuration for your domain. It usually takes around 72 hours to complete the domain verification process.

May throw LimitExceededException. May throw TooManyRequestsException. May throw BadRequestException. May throw ConcurrentModificationException.

Parameter emailIdentity : The email address or domain that you want to verify.

Parameter tags : An array of objects that define the tags (keys and values) that you want to associate with the email identity.

Implementation

Future<CreateEmailIdentityResponse> createEmailIdentity({
  required String emailIdentity,
  List<Tag>? tags,
}) async {
  ArgumentError.checkNotNull(emailIdentity, 'emailIdentity');
  final $payload = <String, dynamic>{
    'EmailIdentity': emailIdentity,
    if (tags != null) 'Tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/v1/email/identities',
    exceptionFnMap: _exceptionFns,
  );
  return CreateEmailIdentityResponse.fromJson(response);
}