{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DuplicateRecordFields #-} {-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StrictData #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE NoImplicitPrelude #-} {-# OPTIONS_GHC -fno-warn-unused-binds #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_GHC -fno-warn-unused-matches #-} -- Derived from AWS service descriptions, licensed under Apache 2.0. -- | -- Module : Amazonka.SES.SendRawEmail -- Copyright : (c) 2013-2023 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay -- Stability : auto-generated -- Portability : non-portable (GHC extensions) -- -- Composes an email message and immediately queues it for sending. -- -- This operation is more flexible than the @SendEmail@ API operation. When -- you use the @SendRawEmail@ operation, you can specify the headers of the -- message as well as its content. This flexibility is useful, for example, -- when you want to send a multipart MIME email (such a message that -- contains both a text and an HTML version). You can also use this -- operation to send messages that include attachments. -- -- The @SendRawEmail@ operation has the following requirements: -- -- - You can only send email from -- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/verify-addresses-and-domains.html verified email addresses or domains>. -- If you try to send email from an address that isn\'t verified, the -- operation results in an \"Email address not verified\" error. -- -- - If your account is still in the -- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/request-production-access.html Amazon SES sandbox>, -- you can only send email to other verified addresses in your account, -- or to addresses that are associated with the -- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/mailbox-simulator.html Amazon SES mailbox simulator>. -- -- - The maximum message size, including attachments, is 10 MB. -- -- - Each message has to include at least one recipient address. A -- recipient address includes any address on the To:, CC:, or BCC: -- lines. -- -- - If you send a single message to more than one recipient address, and -- one of the recipient addresses isn\'t in a valid format (that is, -- it\'s not in the format -- /UserName\@[SubDomain.]Domain.TopLevelDomain/), Amazon SES rejects -- the entire message, even if the other addresses are valid. -- -- - Each message can include up to 50 recipient addresses across the -- To:, CC:, or BCC: lines. If you need to send a single message to -- more than 50 recipients, you have to split the list of recipient -- addresses into groups of less than 50 recipients, and send separate -- messages to each group. -- -- - Amazon SES allows you to specify 8-bit Content-Transfer-Encoding for -- MIME message parts. However, if Amazon SES has to modify the -- contents of your message (for example, if you use open and click -- tracking), 8-bit content isn\'t preserved. For this reason, we -- highly recommend that you encode all content that isn\'t 7-bit -- ASCII. For more information, see -- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/send-email-raw.html#send-email-mime-encoding MIME Encoding> -- in the /Amazon SES Developer Guide/. -- -- Additionally, keep the following considerations in mind when using the -- @SendRawEmail@ operation: -- -- - Although you can customize the message headers when using the -- @SendRawEmail@ operation, Amazon SES will automatically apply its -- own @Message-ID@ and @Date@ headers; if you passed these headers -- when creating the message, they will be overwritten by the values -- that Amazon SES provides. -- -- - If you are using sending authorization to send on behalf of another -- user, @SendRawEmail@ enables you to specify the cross-account -- identity for the email\'s Source, From, and Return-Path parameters -- in one of two ways: you can pass optional parameters @SourceArn@, -- @FromArn@, and\/or @ReturnPathArn@ to the API, or you can include -- the following X-headers in the header of your raw email: -- -- - @X-SES-SOURCE-ARN@ -- -- - @X-SES-FROM-ARN@ -- -- - @X-SES-RETURN-PATH-ARN@ -- -- Don\'t include these X-headers in the DKIM signature. Amazon SES -- removes these before it sends the email. -- -- If you only specify the @SourceIdentityArn@ parameter, Amazon SES -- sets the From and Return-Path addresses to the same identity that -- you specified. -- -- For more information about sending authorization, see the -- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization.html Using Sending Authorization with Amazon SES> -- in the /Amazon SES Developer Guide./ -- -- - For every message that you send, the total number of recipients -- (including each recipient in the To:, CC: and BCC: fields) is -- counted against the maximum number of emails you can send in a -- 24-hour period (your /sending quota/). For more information about -- sending quotas in Amazon SES, see -- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/manage-sending-limits.html Managing Your Amazon SES Sending Limits> -- in the /Amazon SES Developer Guide./ module Amazonka.SES.SendRawEmail ( -- * Creating a Request SendRawEmail (..), newSendRawEmail, -- * Request Lenses sendRawEmail_configurationSetName, sendRawEmail_destinations, sendRawEmail_fromArn, sendRawEmail_returnPathArn, sendRawEmail_source, sendRawEmail_sourceArn, sendRawEmail_tags, sendRawEmail_rawMessage, -- * Destructuring the Response SendRawEmailResponse (..), newSendRawEmailResponse, -- * Response Lenses sendRawEmailResponse_httpStatus, sendRawEmailResponse_messageId, ) where import qualified Amazonka.Core as Core import qualified Amazonka.Core.Lens.Internal as Lens import qualified Amazonka.Data as Data import qualified Amazonka.Prelude as Prelude import qualified Amazonka.Request as Request import qualified Amazonka.Response as Response import Amazonka.SES.Types -- | Represents a request to send a single raw email using Amazon SES. For -- more information, see the -- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/send-email-raw.html Amazon SES Developer Guide>. -- -- /See:/ 'newSendRawEmail' smart constructor. data SendRawEmail = SendRawEmail' { -- | The name of the configuration set to use when you send an email using -- @SendRawEmail@. SendRawEmail -> Maybe Text configurationSetName :: Prelude.Maybe Prelude.Text, -- | A list of destinations for the message, consisting of To:, CC:, and BCC: -- addresses. SendRawEmail -> Maybe [Text] destinations :: Prelude.Maybe [Prelude.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 specify a particular \"From\" address in the header -- of the raw email. -- -- Instead of using this parameter, you can use the X-header -- @X-SES-FROM-ARN@ in the raw message of the email. If you use both the -- @FromArn@ parameter and the corresponding X-header, Amazon SES uses the -- value of the @FromArn@ parameter. -- -- For information about when to use this parameter, see the description of -- @SendRawEmail@ in this guide, or see the -- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization-delegate-sender-tasks-email.html Amazon SES Developer Guide>. SendRawEmail -> Maybe Text fromArn :: Prelude.Maybe Prelude.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 @ReturnPath@ -- 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 @ReturnPathArn@ to be -- @arn:aws:ses:us-east-1:123456789012:identity\/example.com@, and the -- @ReturnPath@ to be @feedback\@example.com@. -- -- Instead of using this parameter, you can use the X-header -- @X-SES-RETURN-PATH-ARN@ in the raw message of the email. If you use both -- the @ReturnPathArn@ parameter and the corresponding X-header, Amazon SES -- uses the value of the @ReturnPathArn@ parameter. -- -- For information about when to use this parameter, see the description of -- @SendRawEmail@ in this guide, or see the -- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization-delegate-sender-tasks-email.html Amazon SES Developer Guide>. SendRawEmail -> Maybe Text returnPathArn :: Prelude.Maybe Prelude.Text, -- | The identity\'s email address. If you do not provide a value for this -- parameter, you must specify a \"From\" address in the raw text of the -- message. (You can also specify both.) -- -- Amazon SES does not support the SMTPUTF8 extension, as described -- in<https://tools.ietf.org/html/rfc6531 RFC6531>. For this reason, the -- /local part/ of a source email address (the part of the email address -- that precedes the \@ sign) may only contain -- <https://en.wikipedia.org/wiki/Email_address#Local-part 7-bit ASCII characters>. -- If the /domain part/ of an address (the part after the \@ sign) contains -- non-ASCII characters, they must be encoded using Punycode, as described -- in <https://tools.ietf.org/html/rfc3492.html RFC3492>. The sender name -- (also known as the /friendly name/) may contain non-ASCII characters. -- These characters must be encoded using MIME encoded-word syntax, as -- described in <https://tools.ietf.org/html/rfc2047 RFC 2047>. MIME -- encoded-word syntax uses the following form: -- @=?charset?encoding?encoded-text?=@. -- -- If you specify the @Source@ parameter and have feedback forwarding -- enabled, then bounces and complaints will be sent to this email address. -- This takes precedence over any Return-Path header that you might include -- in the raw text of the message. SendRawEmail -> Maybe Text source :: Prelude.Maybe Prelude.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 send for the email address specified in the @Source@ -- 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 send from @user\@example.com@, then -- you would specify the @SourceArn@ to be -- @arn:aws:ses:us-east-1:123456789012:identity\/example.com@, and the -- @Source@ to be @user\@example.com@. -- -- Instead of using this parameter, you can use the X-header -- @X-SES-SOURCE-ARN@ in the raw message of the email. If you use both the -- @SourceArn@ parameter and the corresponding X-header, Amazon SES uses -- the value of the @SourceArn@ parameter. -- -- For information about when to use this parameter, see the description of -- @SendRawEmail@ in this guide, or see the -- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization-delegate-sender-tasks-email.html Amazon SES Developer Guide>. SendRawEmail -> Maybe Text sourceArn :: Prelude.Maybe Prelude.Text, -- | A list of tags, in the form of name\/value pairs, to apply to an email -- that you send using @SendRawEmail@. Tags correspond to characteristics -- of the email that you define, so that you can publish email sending -- events. :: Prelude.Maybe [MessageTag], -- | The raw email message itself. The message has to meet the following -- criteria: -- -- - The message has to contain a header and a body, separated by a blank -- line. -- -- - All of the required header fields must be present in the message. -- -- - Each part of a multipart MIME message must be formatted properly. -- -- - Attachments must be of a content type that Amazon SES supports. For -- a list on unsupported content types, see -- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/mime-types.html Unsupported Attachment Types> -- in the /Amazon SES Developer Guide/. -- -- - The entire message must be base64-encoded. -- -- - If any of the MIME parts in your message contain content that is -- outside of the 7-bit ASCII character range, we highly recommend that -- you encode that content. For more information, see -- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/send-email-raw.html Sending Raw Email> -- in the /Amazon SES Developer Guide/. -- -- - Per -- <https://tools.ietf.org/html/rfc5321#section-4.5.3.1.6 RFC 5321>, -- the maximum length of each line of text, including the \<CRLF>, must -- not exceed 1,000 characters. SendRawEmail -> RawMessage rawMessage :: RawMessage } deriving (SendRawEmail -> SendRawEmail -> Bool forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a /= :: SendRawEmail -> SendRawEmail -> Bool $c/= :: SendRawEmail -> SendRawEmail -> Bool == :: SendRawEmail -> SendRawEmail -> Bool $c== :: SendRawEmail -> SendRawEmail -> Bool Prelude.Eq, ReadPrec [SendRawEmail] ReadPrec SendRawEmail Int -> ReadS SendRawEmail ReadS [SendRawEmail] forall a. (Int -> ReadS a) -> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a readListPrec :: ReadPrec [SendRawEmail] $creadListPrec :: ReadPrec [SendRawEmail] readPrec :: ReadPrec SendRawEmail $creadPrec :: ReadPrec SendRawEmail readList :: ReadS [SendRawEmail] $creadList :: ReadS [SendRawEmail] readsPrec :: Int -> ReadS SendRawEmail $creadsPrec :: Int -> ReadS SendRawEmail Prelude.Read, Int -> SendRawEmail -> ShowS [SendRawEmail] -> ShowS SendRawEmail -> String forall a. (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a showList :: [SendRawEmail] -> ShowS $cshowList :: [SendRawEmail] -> ShowS show :: SendRawEmail -> String $cshow :: SendRawEmail -> String showsPrec :: Int -> SendRawEmail -> ShowS $cshowsPrec :: Int -> SendRawEmail -> ShowS Prelude.Show, forall x. Rep SendRawEmail x -> SendRawEmail forall x. SendRawEmail -> Rep SendRawEmail x forall a. (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a $cto :: forall x. Rep SendRawEmail x -> SendRawEmail $cfrom :: forall x. SendRawEmail -> Rep SendRawEmail x Prelude.Generic) -- | -- Create a value of 'SendRawEmail' with all optional fields omitted. -- -- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields. -- -- The following record fields are available, with the corresponding lenses provided -- for backwards compatibility: -- -- 'configurationSetName', 'sendRawEmail_configurationSetName' - The name of the configuration set to use when you send an email using -- @SendRawEmail@. -- -- 'destinations', 'sendRawEmail_destinations' - A list of destinations for the message, consisting of To:, CC:, and BCC: -- addresses. -- -- 'fromArn', 'sendRawEmail_fromArn' - 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 specify a particular \"From\" address in the header -- of the raw email. -- -- Instead of using this parameter, you can use the X-header -- @X-SES-FROM-ARN@ in the raw message of the email. If you use both the -- @FromArn@ parameter and the corresponding X-header, Amazon SES uses the -- value of the @FromArn@ parameter. -- -- For information about when to use this parameter, see the description of -- @SendRawEmail@ in this guide, or see the -- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization-delegate-sender-tasks-email.html Amazon SES Developer Guide>. -- -- 'returnPathArn', 'sendRawEmail_returnPathArn' - 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 @ReturnPath@ -- 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 @ReturnPathArn@ to be -- @arn:aws:ses:us-east-1:123456789012:identity\/example.com@, and the -- @ReturnPath@ to be @feedback\@example.com@. -- -- Instead of using this parameter, you can use the X-header -- @X-SES-RETURN-PATH-ARN@ in the raw message of the email. If you use both -- the @ReturnPathArn@ parameter and the corresponding X-header, Amazon SES -- uses the value of the @ReturnPathArn@ parameter. -- -- For information about when to use this parameter, see the description of -- @SendRawEmail@ in this guide, or see the -- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization-delegate-sender-tasks-email.html Amazon SES Developer Guide>. -- -- 'source', 'sendRawEmail_source' - The identity\'s email address. If you do not provide a value for this -- parameter, you must specify a \"From\" address in the raw text of the -- message. (You can also specify both.) -- -- Amazon SES does not support the SMTPUTF8 extension, as described -- in<https://tools.ietf.org/html/rfc6531 RFC6531>. For this reason, the -- /local part/ of a source email address (the part of the email address -- that precedes the \@ sign) may only contain -- <https://en.wikipedia.org/wiki/Email_address#Local-part 7-bit ASCII characters>. -- If the /domain part/ of an address (the part after the \@ sign) contains -- non-ASCII characters, they must be encoded using Punycode, as described -- in <https://tools.ietf.org/html/rfc3492.html RFC3492>. The sender name -- (also known as the /friendly name/) may contain non-ASCII characters. -- These characters must be encoded using MIME encoded-word syntax, as -- described in <https://tools.ietf.org/html/rfc2047 RFC 2047>. MIME -- encoded-word syntax uses the following form: -- @=?charset?encoding?encoded-text?=@. -- -- If you specify the @Source@ parameter and have feedback forwarding -- enabled, then bounces and complaints will be sent to this email address. -- This takes precedence over any Return-Path header that you might include -- in the raw text of the message. -- -- 'sourceArn', 'sendRawEmail_sourceArn' - 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 send for the email address specified in the @Source@ -- 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 send from @user\@example.com@, then -- you would specify the @SourceArn@ to be -- @arn:aws:ses:us-east-1:123456789012:identity\/example.com@, and the -- @Source@ to be @user\@example.com@. -- -- Instead of using this parameter, you can use the X-header -- @X-SES-SOURCE-ARN@ in the raw message of the email. If you use both the -- @SourceArn@ parameter and the corresponding X-header, Amazon SES uses -- the value of the @SourceArn@ parameter. -- -- For information about when to use this parameter, see the description of -- @SendRawEmail@ in this guide, or see the -- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization-delegate-sender-tasks-email.html Amazon SES Developer Guide>. -- -- 'tags', 'sendRawEmail_tags' - A list of tags, in the form of name\/value pairs, to apply to an email -- that you send using @SendRawEmail@. Tags correspond to characteristics -- of the email that you define, so that you can publish email sending -- events. -- -- 'rawMessage', 'sendRawEmail_rawMessage' - The raw email message itself. The message has to meet the following -- criteria: -- -- - The message has to contain a header and a body, separated by a blank -- line. -- -- - All of the required header fields must be present in the message. -- -- - Each part of a multipart MIME message must be formatted properly. -- -- - Attachments must be of a content type that Amazon SES supports. For -- a list on unsupported content types, see -- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/mime-types.html Unsupported Attachment Types> -- in the /Amazon SES Developer Guide/. -- -- - The entire message must be base64-encoded. -- -- - If any of the MIME parts in your message contain content that is -- outside of the 7-bit ASCII character range, we highly recommend that -- you encode that content. For more information, see -- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/send-email-raw.html Sending Raw Email> -- in the /Amazon SES Developer Guide/. -- -- - Per -- <https://tools.ietf.org/html/rfc5321#section-4.5.3.1.6 RFC 5321>, -- the maximum length of each line of text, including the \<CRLF>, must -- not exceed 1,000 characters. newSendRawEmail :: -- | 'rawMessage' RawMessage -> SendRawEmail newSendRawEmail :: RawMessage -> SendRawEmail newSendRawEmail RawMessage pRawMessage_ = SendRawEmail' { $sel:configurationSetName:SendRawEmail' :: Maybe Text configurationSetName = forall a. Maybe a Prelude.Nothing, $sel:destinations:SendRawEmail' :: Maybe [Text] destinations = forall a. Maybe a Prelude.Nothing, $sel:fromArn:SendRawEmail' :: Maybe Text fromArn = forall a. Maybe a Prelude.Nothing, $sel:returnPathArn:SendRawEmail' :: Maybe Text returnPathArn = forall a. Maybe a Prelude.Nothing, $sel:source:SendRawEmail' :: Maybe Text source = forall a. Maybe a Prelude.Nothing, $sel:sourceArn:SendRawEmail' :: Maybe Text sourceArn = forall a. Maybe a Prelude.Nothing, $sel:tags:SendRawEmail' :: Maybe [MessageTag] tags = forall a. Maybe a Prelude.Nothing, $sel:rawMessage:SendRawEmail' :: RawMessage rawMessage = RawMessage pRawMessage_ } -- | The name of the configuration set to use when you send an email using -- @SendRawEmail@. sendRawEmail_configurationSetName :: Lens.Lens' SendRawEmail (Prelude.Maybe Prelude.Text) sendRawEmail_configurationSetName :: Lens' SendRawEmail (Maybe Text) sendRawEmail_configurationSetName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b Lens.lens (\SendRawEmail' {Maybe Text configurationSetName :: Maybe Text $sel:configurationSetName:SendRawEmail' :: SendRawEmail -> Maybe Text configurationSetName} -> Maybe Text configurationSetName) (\s :: SendRawEmail s@SendRawEmail' {} Maybe Text a -> SendRawEmail s {$sel:configurationSetName:SendRawEmail' :: Maybe Text configurationSetName = Maybe Text a} :: SendRawEmail) -- | A list of destinations for the message, consisting of To:, CC:, and BCC: -- addresses. sendRawEmail_destinations :: Lens.Lens' SendRawEmail (Prelude.Maybe [Prelude.Text]) sendRawEmail_destinations :: Lens' SendRawEmail (Maybe [Text]) sendRawEmail_destinations = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b Lens.lens (\SendRawEmail' {Maybe [Text] destinations :: Maybe [Text] $sel:destinations:SendRawEmail' :: SendRawEmail -> Maybe [Text] destinations} -> Maybe [Text] destinations) (\s :: SendRawEmail s@SendRawEmail' {} Maybe [Text] a -> SendRawEmail s {$sel:destinations:SendRawEmail' :: Maybe [Text] destinations = Maybe [Text] a} :: SendRawEmail) forall b c a. (b -> c) -> (a -> b) -> a -> c Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b. (Functor f, Functor g) => AnIso s t a b -> Iso (f s) (g t) (f a) (g b) Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b Lens.coerced -- | 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 specify a particular \"From\" address in the header -- of the raw email. -- -- Instead of using this parameter, you can use the X-header -- @X-SES-FROM-ARN@ in the raw message of the email. If you use both the -- @FromArn@ parameter and the corresponding X-header, Amazon SES uses the -- value of the @FromArn@ parameter. -- -- For information about when to use this parameter, see the description of -- @SendRawEmail@ in this guide, or see the -- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization-delegate-sender-tasks-email.html Amazon SES Developer Guide>. sendRawEmail_fromArn :: Lens.Lens' SendRawEmail (Prelude.Maybe Prelude.Text) sendRawEmail_fromArn :: Lens' SendRawEmail (Maybe Text) sendRawEmail_fromArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b Lens.lens (\SendRawEmail' {Maybe Text fromArn :: Maybe Text $sel:fromArn:SendRawEmail' :: SendRawEmail -> Maybe Text fromArn} -> Maybe Text fromArn) (\s :: SendRawEmail s@SendRawEmail' {} Maybe Text a -> SendRawEmail s {$sel:fromArn:SendRawEmail' :: Maybe Text fromArn = Maybe Text a} :: SendRawEmail) -- | 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 @ReturnPath@ -- 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 @ReturnPathArn@ to be -- @arn:aws:ses:us-east-1:123456789012:identity\/example.com@, and the -- @ReturnPath@ to be @feedback\@example.com@. -- -- Instead of using this parameter, you can use the X-header -- @X-SES-RETURN-PATH-ARN@ in the raw message of the email. If you use both -- the @ReturnPathArn@ parameter and the corresponding X-header, Amazon SES -- uses the value of the @ReturnPathArn@ parameter. -- -- For information about when to use this parameter, see the description of -- @SendRawEmail@ in this guide, or see the -- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization-delegate-sender-tasks-email.html Amazon SES Developer Guide>. sendRawEmail_returnPathArn :: Lens.Lens' SendRawEmail (Prelude.Maybe Prelude.Text) sendRawEmail_returnPathArn :: Lens' SendRawEmail (Maybe Text) sendRawEmail_returnPathArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b Lens.lens (\SendRawEmail' {Maybe Text returnPathArn :: Maybe Text $sel:returnPathArn:SendRawEmail' :: SendRawEmail -> Maybe Text returnPathArn} -> Maybe Text returnPathArn) (\s :: SendRawEmail s@SendRawEmail' {} Maybe Text a -> SendRawEmail s {$sel:returnPathArn:SendRawEmail' :: Maybe Text returnPathArn = Maybe Text a} :: SendRawEmail) -- | The identity\'s email address. If you do not provide a value for this -- parameter, you must specify a \"From\" address in the raw text of the -- message. (You can also specify both.) -- -- Amazon SES does not support the SMTPUTF8 extension, as described -- in<https://tools.ietf.org/html/rfc6531 RFC6531>. For this reason, the -- /local part/ of a source email address (the part of the email address -- that precedes the \@ sign) may only contain -- <https://en.wikipedia.org/wiki/Email_address#Local-part 7-bit ASCII characters>. -- If the /domain part/ of an address (the part after the \@ sign) contains -- non-ASCII characters, they must be encoded using Punycode, as described -- in <https://tools.ietf.org/html/rfc3492.html RFC3492>. The sender name -- (also known as the /friendly name/) may contain non-ASCII characters. -- These characters must be encoded using MIME encoded-word syntax, as -- described in <https://tools.ietf.org/html/rfc2047 RFC 2047>. MIME -- encoded-word syntax uses the following form: -- @=?charset?encoding?encoded-text?=@. -- -- If you specify the @Source@ parameter and have feedback forwarding -- enabled, then bounces and complaints will be sent to this email address. -- This takes precedence over any Return-Path header that you might include -- in the raw text of the message. sendRawEmail_source :: Lens.Lens' SendRawEmail (Prelude.Maybe Prelude.Text) sendRawEmail_source :: Lens' SendRawEmail (Maybe Text) sendRawEmail_source = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b Lens.lens (\SendRawEmail' {Maybe Text source :: Maybe Text $sel:source:SendRawEmail' :: SendRawEmail -> Maybe Text source} -> Maybe Text source) (\s :: SendRawEmail s@SendRawEmail' {} Maybe Text a -> SendRawEmail s {$sel:source:SendRawEmail' :: Maybe Text source = Maybe Text a} :: SendRawEmail) -- | 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 send for the email address specified in the @Source@ -- 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 send from @user\@example.com@, then -- you would specify the @SourceArn@ to be -- @arn:aws:ses:us-east-1:123456789012:identity\/example.com@, and the -- @Source@ to be @user\@example.com@. -- -- Instead of using this parameter, you can use the X-header -- @X-SES-SOURCE-ARN@ in the raw message of the email. If you use both the -- @SourceArn@ parameter and the corresponding X-header, Amazon SES uses -- the value of the @SourceArn@ parameter. -- -- For information about when to use this parameter, see the description of -- @SendRawEmail@ in this guide, or see the -- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization-delegate-sender-tasks-email.html Amazon SES Developer Guide>. sendRawEmail_sourceArn :: Lens.Lens' SendRawEmail (Prelude.Maybe Prelude.Text) sendRawEmail_sourceArn :: Lens' SendRawEmail (Maybe Text) sendRawEmail_sourceArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b Lens.lens (\SendRawEmail' {Maybe Text sourceArn :: Maybe Text $sel:sourceArn:SendRawEmail' :: SendRawEmail -> Maybe Text sourceArn} -> Maybe Text sourceArn) (\s :: SendRawEmail s@SendRawEmail' {} Maybe Text a -> SendRawEmail s {$sel:sourceArn:SendRawEmail' :: Maybe Text sourceArn = Maybe Text a} :: SendRawEmail) -- | A list of tags, in the form of name\/value pairs, to apply to an email -- that you send using @SendRawEmail@. Tags correspond to characteristics -- of the email that you define, so that you can publish email sending -- events. sendRawEmail_tags :: Lens.Lens' SendRawEmail (Prelude.Maybe [MessageTag]) = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b Lens.lens (\SendRawEmail' {Maybe [MessageTag] tags :: Maybe [MessageTag] $sel:tags:SendRawEmail' :: SendRawEmail -> Maybe [MessageTag] tags} -> Maybe [MessageTag] tags) (\s :: SendRawEmail s@SendRawEmail' {} Maybe [MessageTag] a -> SendRawEmail s {$sel:tags:SendRawEmail' :: Maybe [MessageTag] tags = Maybe [MessageTag] a} :: SendRawEmail) forall b c a. (b -> c) -> (a -> b) -> a -> c Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b. (Functor f, Functor g) => AnIso s t a b -> Iso (f s) (g t) (f a) (g b) Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b Lens.coerced -- | The raw email message itself. The message has to meet the following -- criteria: -- -- - The message has to contain a header and a body, separated by a blank -- line. -- -- - All of the required header fields must be present in the message. -- -- - Each part of a multipart MIME message must be formatted properly. -- -- - Attachments must be of a content type that Amazon SES supports. For -- a list on unsupported content types, see -- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/mime-types.html Unsupported Attachment Types> -- in the /Amazon SES Developer Guide/. -- -- - The entire message must be base64-encoded. -- -- - If any of the MIME parts in your message contain content that is -- outside of the 7-bit ASCII character range, we highly recommend that -- you encode that content. For more information, see -- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/send-email-raw.html Sending Raw Email> -- in the /Amazon SES Developer Guide/. -- -- - Per -- <https://tools.ietf.org/html/rfc5321#section-4.5.3.1.6 RFC 5321>, -- the maximum length of each line of text, including the \<CRLF>, must -- not exceed 1,000 characters. sendRawEmail_rawMessage :: Lens.Lens' SendRawEmail RawMessage sendRawEmail_rawMessage :: Lens' SendRawEmail RawMessage sendRawEmail_rawMessage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b Lens.lens (\SendRawEmail' {RawMessage rawMessage :: RawMessage $sel:rawMessage:SendRawEmail' :: SendRawEmail -> RawMessage rawMessage} -> RawMessage rawMessage) (\s :: SendRawEmail s@SendRawEmail' {} RawMessage a -> SendRawEmail s {$sel:rawMessage:SendRawEmail' :: RawMessage rawMessage = RawMessage a} :: SendRawEmail) instance Core.AWSRequest SendRawEmail where type AWSResponse SendRawEmail = SendRawEmailResponse request :: (Service -> Service) -> SendRawEmail -> Request SendRawEmail request Service -> Service overrides = forall a. ToRequest a => Service -> a -> Request a Request.postQuery (Service -> Service overrides Service defaultService) response :: forall (m :: * -> *). MonadResource m => (ByteStringLazy -> IO ByteStringLazy) -> Service -> Proxy SendRawEmail -> ClientResponse ClientBody -> m (Either Error (ClientResponse (AWSResponse SendRawEmail))) response = forall (m :: * -> *) a. MonadResource m => Text -> (Int -> ResponseHeaders -> [Node] -> Either String (AWSResponse a)) -> (ByteStringLazy -> IO ByteStringLazy) -> Service -> Proxy a -> ClientResponse ClientBody -> m (Either Error (ClientResponse (AWSResponse a))) Response.receiveXMLWrapper Text "SendRawEmailResult" ( \Int s ResponseHeaders h [Node] x -> Int -> Text -> SendRawEmailResponse SendRawEmailResponse' forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b Prelude.<$> (forall (f :: * -> *) a. Applicative f => a -> f a Prelude.pure (forall a. Enum a => a -> Int Prelude.fromEnum Int s)) forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b Prelude.<*> ([Node] x forall a. FromXML a => [Node] -> Text -> Either String a Data..@ Text "MessageId") ) instance Prelude.Hashable SendRawEmail where hashWithSalt :: Int -> SendRawEmail -> Int hashWithSalt Int _salt SendRawEmail' {Maybe [Text] Maybe [MessageTag] Maybe Text RawMessage rawMessage :: RawMessage tags :: Maybe [MessageTag] sourceArn :: Maybe Text source :: Maybe Text returnPathArn :: Maybe Text fromArn :: Maybe Text destinations :: Maybe [Text] configurationSetName :: Maybe Text $sel:rawMessage:SendRawEmail' :: SendRawEmail -> RawMessage $sel:tags:SendRawEmail' :: SendRawEmail -> Maybe [MessageTag] $sel:sourceArn:SendRawEmail' :: SendRawEmail -> Maybe Text $sel:source:SendRawEmail' :: SendRawEmail -> Maybe Text $sel:returnPathArn:SendRawEmail' :: SendRawEmail -> Maybe Text $sel:fromArn:SendRawEmail' :: SendRawEmail -> Maybe Text $sel:destinations:SendRawEmail' :: SendRawEmail -> Maybe [Text] $sel:configurationSetName:SendRawEmail' :: SendRawEmail -> Maybe Text ..} = Int _salt forall a. Hashable a => Int -> a -> Int `Prelude.hashWithSalt` Maybe Text configurationSetName forall a. Hashable a => Int -> a -> Int `Prelude.hashWithSalt` Maybe [Text] destinations forall a. Hashable a => Int -> a -> Int `Prelude.hashWithSalt` Maybe Text fromArn forall a. Hashable a => Int -> a -> Int `Prelude.hashWithSalt` Maybe Text returnPathArn forall a. Hashable a => Int -> a -> Int `Prelude.hashWithSalt` Maybe Text source forall a. Hashable a => Int -> a -> Int `Prelude.hashWithSalt` Maybe Text sourceArn forall a. Hashable a => Int -> a -> Int `Prelude.hashWithSalt` Maybe [MessageTag] tags forall a. Hashable a => Int -> a -> Int `Prelude.hashWithSalt` RawMessage rawMessage instance Prelude.NFData SendRawEmail where rnf :: SendRawEmail -> () rnf SendRawEmail' {Maybe [Text] Maybe [MessageTag] Maybe Text RawMessage rawMessage :: RawMessage tags :: Maybe [MessageTag] sourceArn :: Maybe Text source :: Maybe Text returnPathArn :: Maybe Text fromArn :: Maybe Text destinations :: Maybe [Text] configurationSetName :: Maybe Text $sel:rawMessage:SendRawEmail' :: SendRawEmail -> RawMessage $sel:tags:SendRawEmail' :: SendRawEmail -> Maybe [MessageTag] $sel:sourceArn:SendRawEmail' :: SendRawEmail -> Maybe Text $sel:source:SendRawEmail' :: SendRawEmail -> Maybe Text $sel:returnPathArn:SendRawEmail' :: SendRawEmail -> Maybe Text $sel:fromArn:SendRawEmail' :: SendRawEmail -> Maybe Text $sel:destinations:SendRawEmail' :: SendRawEmail -> Maybe [Text] $sel:configurationSetName:SendRawEmail' :: SendRawEmail -> Maybe Text ..} = forall a. NFData a => a -> () Prelude.rnf Maybe Text configurationSetName seq :: forall a b. a -> b -> b `Prelude.seq` forall a. NFData a => a -> () Prelude.rnf Maybe [Text] destinations seq :: forall a b. a -> b -> b `Prelude.seq` forall a. NFData a => a -> () Prelude.rnf Maybe Text fromArn seq :: forall a b. a -> b -> b `Prelude.seq` forall a. NFData a => a -> () Prelude.rnf Maybe Text returnPathArn seq :: forall a b. a -> b -> b `Prelude.seq` forall a. NFData a => a -> () Prelude.rnf Maybe Text source seq :: forall a b. a -> b -> b `Prelude.seq` forall a. NFData a => a -> () Prelude.rnf Maybe Text sourceArn seq :: forall a b. a -> b -> b `Prelude.seq` forall a. NFData a => a -> () Prelude.rnf Maybe [MessageTag] tags seq :: forall a b. a -> b -> b `Prelude.seq` forall a. NFData a => a -> () Prelude.rnf RawMessage rawMessage instance Data.ToHeaders SendRawEmail where toHeaders :: SendRawEmail -> ResponseHeaders toHeaders = forall a b. a -> b -> a Prelude.const forall a. Monoid a => a Prelude.mempty instance Data.ToPath SendRawEmail where toPath :: SendRawEmail -> ByteString toPath = forall a b. a -> b -> a Prelude.const ByteString "/" instance Data.ToQuery SendRawEmail where toQuery :: SendRawEmail -> QueryString toQuery SendRawEmail' {Maybe [Text] Maybe [MessageTag] Maybe Text RawMessage rawMessage :: RawMessage tags :: Maybe [MessageTag] sourceArn :: Maybe Text source :: Maybe Text returnPathArn :: Maybe Text fromArn :: Maybe Text destinations :: Maybe [Text] configurationSetName :: Maybe Text $sel:rawMessage:SendRawEmail' :: SendRawEmail -> RawMessage $sel:tags:SendRawEmail' :: SendRawEmail -> Maybe [MessageTag] $sel:sourceArn:SendRawEmail' :: SendRawEmail -> Maybe Text $sel:source:SendRawEmail' :: SendRawEmail -> Maybe Text $sel:returnPathArn:SendRawEmail' :: SendRawEmail -> Maybe Text $sel:fromArn:SendRawEmail' :: SendRawEmail -> Maybe Text $sel:destinations:SendRawEmail' :: SendRawEmail -> Maybe [Text] $sel:configurationSetName:SendRawEmail' :: SendRawEmail -> Maybe Text ..} = forall a. Monoid a => [a] -> a Prelude.mconcat [ ByteString "Action" forall a. ToQuery a => ByteString -> a -> QueryString Data.=: (ByteString "SendRawEmail" :: Prelude.ByteString), ByteString "Version" forall a. ToQuery a => ByteString -> a -> QueryString Data.=: (ByteString "2010-12-01" :: Prelude.ByteString), ByteString "ConfigurationSetName" forall a. ToQuery a => ByteString -> a -> QueryString Data.=: Maybe Text configurationSetName, ByteString "Destinations" forall a. ToQuery a => ByteString -> a -> QueryString Data.=: forall a. ToQuery a => a -> QueryString Data.toQuery (forall a. (IsList a, ToQuery (Item a)) => ByteString -> a -> QueryString Data.toQueryList ByteString "member" forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b Prelude.<$> Maybe [Text] destinations), ByteString "FromArn" forall a. ToQuery a => ByteString -> a -> QueryString Data.=: Maybe Text fromArn, ByteString "ReturnPathArn" forall a. ToQuery a => ByteString -> a -> QueryString Data.=: Maybe Text returnPathArn, ByteString "Source" forall a. ToQuery a => ByteString -> a -> QueryString Data.=: Maybe Text source, ByteString "SourceArn" forall a. ToQuery a => ByteString -> a -> QueryString Data.=: Maybe Text sourceArn, ByteString "Tags" forall a. ToQuery a => ByteString -> a -> QueryString Data.=: forall a. ToQuery a => a -> QueryString Data.toQuery (forall a. (IsList a, ToQuery (Item a)) => ByteString -> a -> QueryString Data.toQueryList ByteString "member" forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b Prelude.<$> Maybe [MessageTag] tags), ByteString "RawMessage" forall a. ToQuery a => ByteString -> a -> QueryString Data.=: RawMessage rawMessage ] -- | Represents a unique message ID. -- -- /See:/ 'newSendRawEmailResponse' smart constructor. data SendRawEmailResponse = SendRawEmailResponse' { -- | The response's http status code. SendRawEmailResponse -> Int httpStatus :: Prelude.Int, -- | The unique message identifier returned from the @SendRawEmail@ action. SendRawEmailResponse -> Text messageId :: Prelude.Text } deriving (SendRawEmailResponse -> SendRawEmailResponse -> Bool forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a /= :: SendRawEmailResponse -> SendRawEmailResponse -> Bool $c/= :: SendRawEmailResponse -> SendRawEmailResponse -> Bool == :: SendRawEmailResponse -> SendRawEmailResponse -> Bool $c== :: SendRawEmailResponse -> SendRawEmailResponse -> Bool Prelude.Eq, ReadPrec [SendRawEmailResponse] ReadPrec SendRawEmailResponse Int -> ReadS SendRawEmailResponse ReadS [SendRawEmailResponse] forall a. (Int -> ReadS a) -> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a readListPrec :: ReadPrec [SendRawEmailResponse] $creadListPrec :: ReadPrec [SendRawEmailResponse] readPrec :: ReadPrec SendRawEmailResponse $creadPrec :: ReadPrec SendRawEmailResponse readList :: ReadS [SendRawEmailResponse] $creadList :: ReadS [SendRawEmailResponse] readsPrec :: Int -> ReadS SendRawEmailResponse $creadsPrec :: Int -> ReadS SendRawEmailResponse Prelude.Read, Int -> SendRawEmailResponse -> ShowS [SendRawEmailResponse] -> ShowS SendRawEmailResponse -> String forall a. (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a showList :: [SendRawEmailResponse] -> ShowS $cshowList :: [SendRawEmailResponse] -> ShowS show :: SendRawEmailResponse -> String $cshow :: SendRawEmailResponse -> String showsPrec :: Int -> SendRawEmailResponse -> ShowS $cshowsPrec :: Int -> SendRawEmailResponse -> ShowS Prelude.Show, forall x. Rep SendRawEmailResponse x -> SendRawEmailResponse forall x. SendRawEmailResponse -> Rep SendRawEmailResponse x forall a. (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a $cto :: forall x. Rep SendRawEmailResponse x -> SendRawEmailResponse $cfrom :: forall x. SendRawEmailResponse -> Rep SendRawEmailResponse x Prelude.Generic) -- | -- Create a value of 'SendRawEmailResponse' with all optional fields omitted. -- -- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields. -- -- The following record fields are available, with the corresponding lenses provided -- for backwards compatibility: -- -- 'httpStatus', 'sendRawEmailResponse_httpStatus' - The response's http status code. -- -- 'messageId', 'sendRawEmailResponse_messageId' - The unique message identifier returned from the @SendRawEmail@ action. newSendRawEmailResponse :: -- | 'httpStatus' Prelude.Int -> -- | 'messageId' Prelude.Text -> SendRawEmailResponse newSendRawEmailResponse :: Int -> Text -> SendRawEmailResponse newSendRawEmailResponse Int pHttpStatus_ Text pMessageId_ = SendRawEmailResponse' { $sel:httpStatus:SendRawEmailResponse' :: Int httpStatus = Int pHttpStatus_, $sel:messageId:SendRawEmailResponse' :: Text messageId = Text pMessageId_ } -- | The response's http status code. sendRawEmailResponse_httpStatus :: Lens.Lens' SendRawEmailResponse Prelude.Int sendRawEmailResponse_httpStatus :: Lens' SendRawEmailResponse Int sendRawEmailResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b Lens.lens (\SendRawEmailResponse' {Int httpStatus :: Int $sel:httpStatus:SendRawEmailResponse' :: SendRawEmailResponse -> Int httpStatus} -> Int httpStatus) (\s :: SendRawEmailResponse s@SendRawEmailResponse' {} Int a -> SendRawEmailResponse s {$sel:httpStatus:SendRawEmailResponse' :: Int httpStatus = Int a} :: SendRawEmailResponse) -- | The unique message identifier returned from the @SendRawEmail@ action. sendRawEmailResponse_messageId :: Lens.Lens' SendRawEmailResponse Prelude.Text sendRawEmailResponse_messageId :: Lens' SendRawEmailResponse Text sendRawEmailResponse_messageId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b Lens.lens (\SendRawEmailResponse' {Text messageId :: Text $sel:messageId:SendRawEmailResponse' :: SendRawEmailResponse -> Text messageId} -> Text messageId) (\s :: SendRawEmailResponse s@SendRawEmailResponse' {} Text a -> SendRawEmailResponse s {$sel:messageId:SendRawEmailResponse' :: Text messageId = Text a} :: SendRawEmailResponse) instance Prelude.NFData SendRawEmailResponse where rnf :: SendRawEmailResponse -> () rnf SendRawEmailResponse' {Int Text messageId :: Text httpStatus :: Int $sel:messageId:SendRawEmailResponse' :: SendRawEmailResponse -> Text $sel:httpStatus:SendRawEmailResponse' :: SendRawEmailResponse -> Int ..} = forall a. NFData a => a -> () Prelude.rnf Int httpStatus seq :: forall a b. a -> b -> b `Prelude.seq` forall a. NFData a => a -> () Prelude.rnf Text messageId