Copyright | (c) 2013-2021 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay <brendan.g.hay+amazonka@gmail.com> |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | None |
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
- data SendEmail = SendEmail' {
- fromEmailAddress :: Maybe Text
- destination :: Maybe Destination
- fromEmailAddressIdentityArn :: Maybe Text
- configurationSetName :: Maybe Text
- listManagementOptions :: Maybe ListManagementOptions
- emailTags :: Maybe [MessageTag]
- feedbackForwardingEmailAddress :: Maybe Text
- feedbackForwardingEmailAddressIdentityArn :: Maybe Text
- replyToAddresses :: Maybe [Text]
- content :: EmailContent
- newSendEmail :: EmailContent -> SendEmail
- sendEmail_fromEmailAddress :: Lens' SendEmail (Maybe Text)
- sendEmail_destination :: Lens' SendEmail (Maybe Destination)
- sendEmail_fromEmailAddressIdentityArn :: Lens' SendEmail (Maybe Text)
- sendEmail_configurationSetName :: Lens' SendEmail (Maybe Text)
- sendEmail_listManagementOptions :: Lens' SendEmail (Maybe ListManagementOptions)
- sendEmail_emailTags :: Lens' SendEmail (Maybe [MessageTag])
- sendEmail_feedbackForwardingEmailAddress :: Lens' SendEmail (Maybe Text)
- sendEmail_feedbackForwardingEmailAddressIdentityArn :: Lens' SendEmail (Maybe Text)
- sendEmail_replyToAddresses :: Lens' SendEmail (Maybe [Text])
- sendEmail_content :: Lens' SendEmail EmailContent
- data SendEmailResponse = SendEmailResponse' {
- messageId :: Maybe Text
- httpStatus :: Int
- newSendEmailResponse :: Int -> SendEmailResponse
- sendEmailResponse_messageId :: Lens' SendEmailResponse (Maybe Text)
- sendEmailResponse_httpStatus :: Lens' SendEmailResponse Int
Creating a Request
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.
SendEmail' | |
|
Instances
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.
SendEmailResponse' | |
|
Instances
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.