libZSservicesZSamazonka-sesv2ZSamazonka-sesv2
Copyright(c) 2013-2021 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay+amazonka@gmail.com>
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellNone

Amazonka.SESV2.SendEmail

Description

Sends an email message. You can use the Amazon SES API v2 to send the following types of messages:

  • Simple – A standard email message. When you create this type of message, you specify the sender, the recipient, and the message body, and Amazon SES assembles the message for you.
  • Raw – A raw, MIME-formatted email message. When you send this type of email, you have to specify all of the message headers, as well as the message body. You can use this message type to send messages that contain attachments. The message that you specify has to be a valid MIME message.
  • Templated – A message that contains personalization tags. When you send this type of email, Amazon SES API v2 automatically replaces the tags with values that you specify.
Synopsis

Creating a Request

data SendEmail Source #

Represents a request to send a single formatted email using Amazon SES. For more information, see the Amazon SES Developer Guide.

See: newSendEmail smart constructor.

Constructors

SendEmail' 

Fields

  • fromEmailAddress :: Maybe Text

    The email address to use as the "From" address for the email. The address that you specify has to be verified.

  • destination :: Maybe Destination

    An object that contains the recipients of the email message.

  • fromEmailAddressIdentityArn :: Maybe Text

    This parameter is used only for sending authorization. It is the ARN of the identity that is associated with the sending authorization policy that permits you to use the email address specified in the FromEmailAddress parameter.

    For example, if the owner of example.com (which has ARN arn:aws:ses:us-east-1:123456789012:identity/example.com) attaches a policy to it that authorizes you to use sender@example.com, then you would specify the FromEmailAddressIdentityArn to be arn:aws:ses:us-east-1:123456789012:identity/example.com, and the FromEmailAddress to be sender@example.com.

    For more information about sending authorization, see the Amazon SES Developer Guide.

    For Raw emails, the FromEmailAddressIdentityArn value overrides the X-SES-SOURCE-ARN and X-SES-FROM-ARN headers specified in raw email message content.

  • configurationSetName :: Maybe Text

    The name of the configuration set to use when sending the email.

  • listManagementOptions :: Maybe ListManagementOptions

    An object used to specify a list or topic to which an email belongs, which will be used when a contact chooses to unsubscribe.

  • emailTags :: Maybe [MessageTag]

    A list of tags, in the form of name/value pairs, to apply to an email that you send using the SendEmail operation. Tags correspond to characteristics of the email that you define, so that you can publish email sending events.

  • feedbackForwardingEmailAddress :: Maybe Text

    The address that you want bounce and complaint notifications to be sent to.

  • feedbackForwardingEmailAddressIdentityArn :: Maybe Text

    This parameter is used only for sending authorization. It is the ARN of the identity that is associated with the sending authorization policy that permits you to use the email address specified in the FeedbackForwardingEmailAddress parameter.

    For example, if the owner of example.com (which has ARN arn:aws:ses:us-east-1:123456789012:identity/example.com) attaches a policy to it that authorizes you to use feedback@example.com, then you would specify the FeedbackForwardingEmailAddressIdentityArn to be arn:aws:ses:us-east-1:123456789012:identity/example.com, and the FeedbackForwardingEmailAddress to be feedback@example.com.

    For more information about sending authorization, see the Amazon SES Developer Guide.

  • replyToAddresses :: Maybe [Text]

    The "Reply-to" email addresses for the message. When the recipient replies to the message, each Reply-to address receives the reply.

  • content :: EmailContent

    An object that contains the body of the message. You can send either a Simple message Raw message or a template Message.

Instances

Instances details
Eq SendEmail Source # 
Instance details

Defined in Amazonka.SESV2.SendEmail

Read SendEmail Source # 
Instance details

Defined in Amazonka.SESV2.SendEmail

Show SendEmail Source # 
Instance details

Defined in Amazonka.SESV2.SendEmail

Generic SendEmail Source # 
Instance details

Defined in Amazonka.SESV2.SendEmail

Associated Types

type Rep SendEmail :: Type -> Type #

NFData SendEmail Source # 
Instance details

Defined in Amazonka.SESV2.SendEmail

Methods

rnf :: SendEmail -> () #

Hashable SendEmail Source # 
Instance details

Defined in Amazonka.SESV2.SendEmail

ToJSON SendEmail Source # 
Instance details

Defined in Amazonka.SESV2.SendEmail

AWSRequest SendEmail Source # 
Instance details

Defined in Amazonka.SESV2.SendEmail

Associated Types

type AWSResponse SendEmail #

ToHeaders SendEmail Source # 
Instance details

Defined in Amazonka.SESV2.SendEmail

Methods

toHeaders :: SendEmail -> [Header] #

ToPath SendEmail Source # 
Instance details

Defined in Amazonka.SESV2.SendEmail

ToQuery SendEmail Source # 
Instance details

Defined in Amazonka.SESV2.SendEmail

type Rep SendEmail Source # 
Instance details

Defined in Amazonka.SESV2.SendEmail

type Rep SendEmail = D1 ('MetaData "SendEmail" "Amazonka.SESV2.SendEmail" "libZSservicesZSamazonka-sesv2ZSamazonka-sesv2" 'False) (C1 ('MetaCons "SendEmail'" 'PrefixI 'True) (((S1 ('MetaSel ('Just "fromEmailAddress") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "destination") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Destination))) :*: (S1 ('MetaSel ('Just "fromEmailAddressIdentityArn") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: (S1 ('MetaSel ('Just "configurationSetName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "listManagementOptions") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe ListManagementOptions))))) :*: ((S1 ('MetaSel ('Just "emailTags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [MessageTag])) :*: S1 ('MetaSel ('Just "feedbackForwardingEmailAddress") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text))) :*: (S1 ('MetaSel ('Just "feedbackForwardingEmailAddressIdentityArn") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: (S1 ('MetaSel ('Just "replyToAddresses") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [Text])) :*: S1 ('MetaSel ('Just "content") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 EmailContent))))))
type AWSResponse SendEmail Source # 
Instance details

Defined in Amazonka.SESV2.SendEmail

newSendEmail Source #

Create a value of SendEmail with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

$sel:fromEmailAddress:SendEmail', sendEmail_fromEmailAddress - The email address to use as the "From" address for the email. The address that you specify has to be verified.

$sel:destination:SendEmail', sendEmail_destination - An object that contains the recipients of the email message.

$sel:fromEmailAddressIdentityArn:SendEmail', sendEmail_fromEmailAddressIdentityArn - This parameter is used only for sending authorization. It is the ARN of the identity that is associated with the sending authorization policy that permits you to use the email address specified in the FromEmailAddress parameter.

For example, if the owner of example.com (which has ARN arn:aws:ses:us-east-1:123456789012:identity/example.com) attaches a policy to it that authorizes you to use sender@example.com, then you would specify the FromEmailAddressIdentityArn to be arn:aws:ses:us-east-1:123456789012:identity/example.com, and the FromEmailAddress to be sender@example.com.

For more information about sending authorization, see the Amazon SES Developer Guide.

For Raw emails, the FromEmailAddressIdentityArn value overrides the X-SES-SOURCE-ARN and X-SES-FROM-ARN headers specified in raw email message content.

$sel:configurationSetName:SendEmail', sendEmail_configurationSetName - The name of the configuration set to use when sending the email.

$sel:listManagementOptions:SendEmail', sendEmail_listManagementOptions - An object used to specify a list or topic to which an email belongs, which will be used when a contact chooses to unsubscribe.

$sel:emailTags:SendEmail', sendEmail_emailTags - A list of tags, in the form of name/value pairs, to apply to an email that you send using the SendEmail operation. Tags correspond to characteristics of the email that you define, so that you can publish email sending events.

$sel:feedbackForwardingEmailAddress:SendEmail', sendEmail_feedbackForwardingEmailAddress - The address that you want bounce and complaint notifications to be sent to.

$sel:feedbackForwardingEmailAddressIdentityArn:SendEmail', sendEmail_feedbackForwardingEmailAddressIdentityArn - This parameter is used only for sending authorization. It is the ARN of the identity that is associated with the sending authorization policy that permits you to use the email address specified in the FeedbackForwardingEmailAddress parameter.

For example, if the owner of example.com (which has ARN arn:aws:ses:us-east-1:123456789012:identity/example.com) attaches a policy to it that authorizes you to use feedback@example.com, then you would specify the FeedbackForwardingEmailAddressIdentityArn to be arn:aws:ses:us-east-1:123456789012:identity/example.com, and the FeedbackForwardingEmailAddress to be feedback@example.com.

For more information about sending authorization, see the Amazon SES Developer Guide.

$sel:replyToAddresses:SendEmail', sendEmail_replyToAddresses - The "Reply-to" email addresses for the message. When the recipient replies to the message, each Reply-to address receives the reply.

$sel:content:SendEmail', sendEmail_content - An object that contains the body of the message. You can send either a Simple message Raw message or a template Message.

Request Lenses

sendEmail_fromEmailAddress :: Lens' SendEmail (Maybe Text) Source #

The email address to use as the "From" address for the email. The address that you specify has to be verified.

sendEmail_destination :: Lens' SendEmail (Maybe Destination) Source #

An object that contains the recipients of the email message.

sendEmail_fromEmailAddressIdentityArn :: Lens' SendEmail (Maybe Text) Source #

This parameter is used only for sending authorization. It is the ARN of the identity that is associated with the sending authorization policy that permits you to use the email address specified in the FromEmailAddress parameter.

For example, if the owner of example.com (which has ARN arn:aws:ses:us-east-1:123456789012:identity/example.com) attaches a policy to it that authorizes you to use sender@example.com, then you would specify the FromEmailAddressIdentityArn to be arn:aws:ses:us-east-1:123456789012:identity/example.com, and the FromEmailAddress to be sender@example.com.

For more information about sending authorization, see the Amazon SES Developer Guide.

For Raw emails, the FromEmailAddressIdentityArn value overrides the X-SES-SOURCE-ARN and X-SES-FROM-ARN headers specified in raw email message content.

sendEmail_configurationSetName :: Lens' SendEmail (Maybe Text) Source #

The name of the configuration set to use when sending the email.

sendEmail_listManagementOptions :: Lens' SendEmail (Maybe ListManagementOptions) Source #

An object used to specify a list or topic to which an email belongs, which will be used when a contact chooses to unsubscribe.

sendEmail_emailTags :: Lens' SendEmail (Maybe [MessageTag]) Source #

A list of tags, in the form of name/value pairs, to apply to an email that you send using the SendEmail operation. Tags correspond to characteristics of the email that you define, so that you can publish email sending events.

sendEmail_feedbackForwardingEmailAddress :: Lens' SendEmail (Maybe Text) Source #

The address that you want bounce and complaint notifications to be sent to.

sendEmail_feedbackForwardingEmailAddressIdentityArn :: Lens' SendEmail (Maybe Text) Source #

This parameter is used only for sending authorization. It is the ARN of the identity that is associated with the sending authorization policy that permits you to use the email address specified in the FeedbackForwardingEmailAddress parameter.

For example, if the owner of example.com (which has ARN arn:aws:ses:us-east-1:123456789012:identity/example.com) attaches a policy to it that authorizes you to use feedback@example.com, then you would specify the FeedbackForwardingEmailAddressIdentityArn to be arn:aws:ses:us-east-1:123456789012:identity/example.com, and the FeedbackForwardingEmailAddress to be feedback@example.com.

For more information about sending authorization, see the Amazon SES Developer Guide.

sendEmail_replyToAddresses :: Lens' SendEmail (Maybe [Text]) Source #

The "Reply-to" email addresses for the message. When the recipient replies to the message, each Reply-to address receives the reply.

sendEmail_content :: Lens' SendEmail EmailContent Source #

An object that contains the body of the message. You can send either a Simple message Raw message or a template Message.

Destructuring the Response

data SendEmailResponse Source #

A unique message ID that you receive when an email is accepted for sending.

See: newSendEmailResponse smart constructor.

Constructors

SendEmailResponse' 

Fields

  • messageId :: Maybe Text

    A unique identifier for the message that is generated when the message is accepted.

    It's possible for Amazon SES to accept a message without sending it. This can happen when the message that you're trying to send has an attachment contains a virus, or when you send a templated email that contains invalid personalization content, for example.

  • httpStatus :: Int

    The response's http status code.

Instances

Instances details
Eq SendEmailResponse Source # 
Instance details

Defined in Amazonka.SESV2.SendEmail

Read SendEmailResponse Source # 
Instance details

Defined in Amazonka.SESV2.SendEmail

Show SendEmailResponse Source # 
Instance details

Defined in Amazonka.SESV2.SendEmail

Generic SendEmailResponse Source # 
Instance details

Defined in Amazonka.SESV2.SendEmail

Associated Types

type Rep SendEmailResponse :: Type -> Type #

NFData SendEmailResponse Source # 
Instance details

Defined in Amazonka.SESV2.SendEmail

Methods

rnf :: SendEmailResponse -> () #

type Rep SendEmailResponse Source # 
Instance details

Defined in Amazonka.SESV2.SendEmail

type Rep SendEmailResponse = D1 ('MetaData "SendEmailResponse" "Amazonka.SESV2.SendEmail" "libZSservicesZSamazonka-sesv2ZSamazonka-sesv2" 'False) (C1 ('MetaCons "SendEmailResponse'" 'PrefixI 'True) (S1 ('MetaSel ('Just "messageId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "httpStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int)))

newSendEmailResponse Source #

Create a value of SendEmailResponse with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

$sel:messageId:SendEmailResponse', sendEmailResponse_messageId - A unique identifier for the message that is generated when the message is accepted.

It's possible for Amazon SES to accept a message without sending it. This can happen when the message that you're trying to send has an attachment contains a virus, or when you send a templated email that contains invalid personalization content, for example.

$sel:httpStatus:SendEmailResponse', sendEmailResponse_httpStatus - The response's http status code.

Response Lenses

sendEmailResponse_messageId :: Lens' SendEmailResponse (Maybe Text) Source #

A unique identifier for the message that is generated when the message is accepted.

It's possible for Amazon SES to accept a message without sending it. This can happen when the message that you're trying to send has an attachment contains a virus, or when you send a templated email that contains invalid personalization content, for example.

sendEmailResponse_httpStatus :: Lens' SendEmailResponse Int Source #

The response's http status code.