{-# 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.SendTemplatedEmail
-- 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 using an email template and immediately queues
-- it for sending.
--
-- In order to send email using the @SendTemplatedEmail@ operation, your
-- call to the API must meet the following requirements:
--
-- -   The call must refer to an existing email template. You can create
--     email templates using the CreateTemplate operation.
--
-- -   The message must be sent from a verified email address or domain.
--
-- -   If your account is still in the Amazon SES sandbox, you may only
--     send to verified addresses or domains, or to email addresses
--     associated with the Amazon SES Mailbox Simulator. For more
--     information, see
--     <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/verify-addresses-and-domains.html Verifying Email Addresses and Domains>
--     in the /Amazon SES Developer Guide./
--
-- -   The maximum message size is 10 MB.
--
-- -   Calls to the @SendTemplatedEmail@ operation may only include one
--     @Destination@ parameter. A destination is a set of recipients who
--     will receive the same version of the email. The @Destination@
--     parameter can include up to 50 recipients, across the To:, CC: and
--     BCC: fields.
--
-- -   The @Destination@ parameter must include at least one recipient
--     email address. The recipient address can be a To: address, a CC:
--     address, or a BCC: address. If a recipient email address is invalid
--     (that is, it is not in the format
--     /UserName\@[SubDomain.]Domain.TopLevelDomain/), the entire message
--     will be rejected, even if the message contains other recipients that
--     are valid.
--
-- If your call to the @SendTemplatedEmail@ operation includes all of the
-- required parameters, Amazon SES accepts it and returns a Message ID.
-- However, if Amazon SES can\'t render the email because the template
-- contains errors, it doesn\'t send the email. Additionally, because it
-- already accepted the message, Amazon SES doesn\'t return a message
-- stating that it was unable to send the email.
--
-- For these reasons, we highly recommend that you set up Amazon SES to
-- send you notifications when Rendering Failure events occur. For more
-- information, see
-- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/send-personalized-email-api.html Sending Personalized Email Using the Amazon SES API>
-- in the /Amazon Simple Email Service Developer Guide/.
module Amazonka.SES.SendTemplatedEmail
  ( -- * Creating a Request
    SendTemplatedEmail (..),
    newSendTemplatedEmail,

    -- * Request Lenses
    sendTemplatedEmail_configurationSetName,
    sendTemplatedEmail_replyToAddresses,
    sendTemplatedEmail_returnPath,
    sendTemplatedEmail_returnPathArn,
    sendTemplatedEmail_sourceArn,
    sendTemplatedEmail_tags,
    sendTemplatedEmail_templateArn,
    sendTemplatedEmail_source,
    sendTemplatedEmail_destination,
    sendTemplatedEmail_template,
    sendTemplatedEmail_templateData,

    -- * Destructuring the Response
    SendTemplatedEmailResponse (..),
    newSendTemplatedEmailResponse,

    -- * Response Lenses
    sendTemplatedEmailResponse_httpStatus,
    sendTemplatedEmailResponse_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 templated email using Amazon SES. For
-- more information, see the
-- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/send-personalized-email-api.html Amazon SES Developer Guide>.
--
-- /See:/ 'newSendTemplatedEmail' smart constructor.
data SendTemplatedEmail = SendTemplatedEmail'
  { -- | The name of the configuration set to use when you send an email using
    -- @SendTemplatedEmail@.
    SendTemplatedEmail -> Maybe Text
configurationSetName :: Prelude.Maybe Prelude.Text,
    -- | The reply-to email address(es) for the message. If the recipient replies
    -- to the message, each reply-to address will receive the reply.
    SendTemplatedEmail -> Maybe [Text]
replyToAddresses :: Prelude.Maybe [Prelude.Text],
    -- | The email address that bounces and complaints will be forwarded to when
    -- feedback forwarding is enabled. If the message cannot be delivered to
    -- the recipient, then an error message will be returned from the
    -- recipient\'s ISP; this message will then be forwarded to the email
    -- address specified by the @ReturnPath@ parameter. The @ReturnPath@
    -- parameter is never overwritten. This email address must be either
    -- individually verified with Amazon SES, or from a domain that has been
    -- verified with Amazon SES.
    SendTemplatedEmail -> Maybe Text
returnPath :: 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@.
    --
    -- For more information about sending authorization, see the
    -- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization.html Amazon SES Developer Guide>.
    SendTemplatedEmail -> Maybe Text
returnPathArn :: 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@.
    --
    -- For more information about sending authorization, see the
    -- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization.html Amazon SES Developer Guide>.
    SendTemplatedEmail -> 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 @SendTemplatedEmail@. Tags correspond to
    -- characteristics of the email that you define, so that you can publish
    -- email sending events.
    SendTemplatedEmail -> Maybe [MessageTag]
tags :: Prelude.Maybe [MessageTag],
    -- | The ARN of the template to use when sending this email.
    SendTemplatedEmail -> Maybe Text
templateArn :: Prelude.Maybe Prelude.Text,
    -- | The email address that is sending the email. This email address must be
    -- either individually verified with Amazon SES, or from a domain that has
    -- been verified with Amazon SES. For information about verifying
    -- identities, see the
    -- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/verify-addresses-and-domains.html Amazon SES Developer Guide>.
    --
    -- If you are sending on behalf of another user and have been permitted to
    -- do so by a sending authorization policy, then you must also specify the
    -- @SourceArn@ parameter. For more information about sending authorization,
    -- see the
    -- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization.html Amazon SES Developer Guide>.
    --
    -- 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?=@.
    SendTemplatedEmail -> Text
source :: Prelude.Text,
    -- | The destination for this email, composed of To:, CC:, and BCC: fields. A
    -- Destination can include up to 50 recipients across these three fields.
    SendTemplatedEmail -> Destination
destination :: Destination,
    -- | The template to use when sending this email.
    SendTemplatedEmail -> Text
template :: Prelude.Text,
    -- | A list of replacement values to apply to the template. This parameter is
    -- a JSON object, typically consisting of key-value pairs in which the keys
    -- correspond to replacement tags in the email template.
    SendTemplatedEmail -> Text
templateData :: Prelude.Text
  }
  deriving (SendTemplatedEmail -> SendTemplatedEmail -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SendTemplatedEmail -> SendTemplatedEmail -> Bool
$c/= :: SendTemplatedEmail -> SendTemplatedEmail -> Bool
== :: SendTemplatedEmail -> SendTemplatedEmail -> Bool
$c== :: SendTemplatedEmail -> SendTemplatedEmail -> Bool
Prelude.Eq, ReadPrec [SendTemplatedEmail]
ReadPrec SendTemplatedEmail
Int -> ReadS SendTemplatedEmail
ReadS [SendTemplatedEmail]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SendTemplatedEmail]
$creadListPrec :: ReadPrec [SendTemplatedEmail]
readPrec :: ReadPrec SendTemplatedEmail
$creadPrec :: ReadPrec SendTemplatedEmail
readList :: ReadS [SendTemplatedEmail]
$creadList :: ReadS [SendTemplatedEmail]
readsPrec :: Int -> ReadS SendTemplatedEmail
$creadsPrec :: Int -> ReadS SendTemplatedEmail
Prelude.Read, Int -> SendTemplatedEmail -> ShowS
[SendTemplatedEmail] -> ShowS
SendTemplatedEmail -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SendTemplatedEmail] -> ShowS
$cshowList :: [SendTemplatedEmail] -> ShowS
show :: SendTemplatedEmail -> String
$cshow :: SendTemplatedEmail -> String
showsPrec :: Int -> SendTemplatedEmail -> ShowS
$cshowsPrec :: Int -> SendTemplatedEmail -> ShowS
Prelude.Show, forall x. Rep SendTemplatedEmail x -> SendTemplatedEmail
forall x. SendTemplatedEmail -> Rep SendTemplatedEmail x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SendTemplatedEmail x -> SendTemplatedEmail
$cfrom :: forall x. SendTemplatedEmail -> Rep SendTemplatedEmail x
Prelude.Generic)

-- |
-- Create a value of 'SendTemplatedEmail' 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', 'sendTemplatedEmail_configurationSetName' - The name of the configuration set to use when you send an email using
-- @SendTemplatedEmail@.
--
-- 'replyToAddresses', 'sendTemplatedEmail_replyToAddresses' - The reply-to email address(es) for the message. If the recipient replies
-- to the message, each reply-to address will receive the reply.
--
-- 'returnPath', 'sendTemplatedEmail_returnPath' - The email address that bounces and complaints will be forwarded to when
-- feedback forwarding is enabled. If the message cannot be delivered to
-- the recipient, then an error message will be returned from the
-- recipient\'s ISP; this message will then be forwarded to the email
-- address specified by the @ReturnPath@ parameter. The @ReturnPath@
-- parameter is never overwritten. This email address must be either
-- individually verified with Amazon SES, or from a domain that has been
-- verified with Amazon SES.
--
-- 'returnPathArn', 'sendTemplatedEmail_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@.
--
-- For more information about sending authorization, see the
-- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization.html Amazon SES Developer Guide>.
--
-- 'sourceArn', 'sendTemplatedEmail_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@.
--
-- For more information about sending authorization, see the
-- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization.html Amazon SES Developer Guide>.
--
-- 'tags', 'sendTemplatedEmail_tags' - A list of tags, in the form of name\/value pairs, to apply to an email
-- that you send using @SendTemplatedEmail@. Tags correspond to
-- characteristics of the email that you define, so that you can publish
-- email sending events.
--
-- 'templateArn', 'sendTemplatedEmail_templateArn' - The ARN of the template to use when sending this email.
--
-- 'source', 'sendTemplatedEmail_source' - The email address that is sending the email. This email address must be
-- either individually verified with Amazon SES, or from a domain that has
-- been verified with Amazon SES. For information about verifying
-- identities, see the
-- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/verify-addresses-and-domains.html Amazon SES Developer Guide>.
--
-- If you are sending on behalf of another user and have been permitted to
-- do so by a sending authorization policy, then you must also specify the
-- @SourceArn@ parameter. For more information about sending authorization,
-- see the
-- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization.html Amazon SES Developer Guide>.
--
-- 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?=@.
--
-- 'destination', 'sendTemplatedEmail_destination' - The destination for this email, composed of To:, CC:, and BCC: fields. A
-- Destination can include up to 50 recipients across these three fields.
--
-- 'template', 'sendTemplatedEmail_template' - The template to use when sending this email.
--
-- 'templateData', 'sendTemplatedEmail_templateData' - A list of replacement values to apply to the template. This parameter is
-- a JSON object, typically consisting of key-value pairs in which the keys
-- correspond to replacement tags in the email template.
newSendTemplatedEmail ::
  -- | 'source'
  Prelude.Text ->
  -- | 'destination'
  Destination ->
  -- | 'template'
  Prelude.Text ->
  -- | 'templateData'
  Prelude.Text ->
  SendTemplatedEmail
newSendTemplatedEmail :: Text -> Destination -> Text -> Text -> SendTemplatedEmail
newSendTemplatedEmail
  Text
pSource_
  Destination
pDestination_
  Text
pTemplate_
  Text
pTemplateData_ =
    SendTemplatedEmail'
      { $sel:configurationSetName:SendTemplatedEmail' :: Maybe Text
configurationSetName =
          forall a. Maybe a
Prelude.Nothing,
        $sel:replyToAddresses:SendTemplatedEmail' :: Maybe [Text]
replyToAddresses = forall a. Maybe a
Prelude.Nothing,
        $sel:returnPath:SendTemplatedEmail' :: Maybe Text
returnPath = forall a. Maybe a
Prelude.Nothing,
        $sel:returnPathArn:SendTemplatedEmail' :: Maybe Text
returnPathArn = forall a. Maybe a
Prelude.Nothing,
        $sel:sourceArn:SendTemplatedEmail' :: Maybe Text
sourceArn = forall a. Maybe a
Prelude.Nothing,
        $sel:tags:SendTemplatedEmail' :: Maybe [MessageTag]
tags = forall a. Maybe a
Prelude.Nothing,
        $sel:templateArn:SendTemplatedEmail' :: Maybe Text
templateArn = forall a. Maybe a
Prelude.Nothing,
        $sel:source:SendTemplatedEmail' :: Text
source = Text
pSource_,
        $sel:destination:SendTemplatedEmail' :: Destination
destination = Destination
pDestination_,
        $sel:template:SendTemplatedEmail' :: Text
template = Text
pTemplate_,
        $sel:templateData:SendTemplatedEmail' :: Text
templateData = Text
pTemplateData_
      }

-- | The name of the configuration set to use when you send an email using
-- @SendTemplatedEmail@.
sendTemplatedEmail_configurationSetName :: Lens.Lens' SendTemplatedEmail (Prelude.Maybe Prelude.Text)
sendTemplatedEmail_configurationSetName :: Lens' SendTemplatedEmail (Maybe Text)
sendTemplatedEmail_configurationSetName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendTemplatedEmail' {Maybe Text
configurationSetName :: Maybe Text
$sel:configurationSetName:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe Text
configurationSetName} -> Maybe Text
configurationSetName) (\s :: SendTemplatedEmail
s@SendTemplatedEmail' {} Maybe Text
a -> SendTemplatedEmail
s {$sel:configurationSetName:SendTemplatedEmail' :: Maybe Text
configurationSetName = Maybe Text
a} :: SendTemplatedEmail)

-- | The reply-to email address(es) for the message. If the recipient replies
-- to the message, each reply-to address will receive the reply.
sendTemplatedEmail_replyToAddresses :: Lens.Lens' SendTemplatedEmail (Prelude.Maybe [Prelude.Text])
sendTemplatedEmail_replyToAddresses :: Lens' SendTemplatedEmail (Maybe [Text])
sendTemplatedEmail_replyToAddresses = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendTemplatedEmail' {Maybe [Text]
replyToAddresses :: Maybe [Text]
$sel:replyToAddresses:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe [Text]
replyToAddresses} -> Maybe [Text]
replyToAddresses) (\s :: SendTemplatedEmail
s@SendTemplatedEmail' {} Maybe [Text]
a -> SendTemplatedEmail
s {$sel:replyToAddresses:SendTemplatedEmail' :: Maybe [Text]
replyToAddresses = Maybe [Text]
a} :: SendTemplatedEmail) 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 email address that bounces and complaints will be forwarded to when
-- feedback forwarding is enabled. If the message cannot be delivered to
-- the recipient, then an error message will be returned from the
-- recipient\'s ISP; this message will then be forwarded to the email
-- address specified by the @ReturnPath@ parameter. The @ReturnPath@
-- parameter is never overwritten. This email address must be either
-- individually verified with Amazon SES, or from a domain that has been
-- verified with Amazon SES.
sendTemplatedEmail_returnPath :: Lens.Lens' SendTemplatedEmail (Prelude.Maybe Prelude.Text)
sendTemplatedEmail_returnPath :: Lens' SendTemplatedEmail (Maybe Text)
sendTemplatedEmail_returnPath = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendTemplatedEmail' {Maybe Text
returnPath :: Maybe Text
$sel:returnPath:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe Text
returnPath} -> Maybe Text
returnPath) (\s :: SendTemplatedEmail
s@SendTemplatedEmail' {} Maybe Text
a -> SendTemplatedEmail
s {$sel:returnPath:SendTemplatedEmail' :: Maybe Text
returnPath = Maybe Text
a} :: SendTemplatedEmail)

-- | 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@.
--
-- For more information about sending authorization, see the
-- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization.html Amazon SES Developer Guide>.
sendTemplatedEmail_returnPathArn :: Lens.Lens' SendTemplatedEmail (Prelude.Maybe Prelude.Text)
sendTemplatedEmail_returnPathArn :: Lens' SendTemplatedEmail (Maybe Text)
sendTemplatedEmail_returnPathArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendTemplatedEmail' {Maybe Text
returnPathArn :: Maybe Text
$sel:returnPathArn:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe Text
returnPathArn} -> Maybe Text
returnPathArn) (\s :: SendTemplatedEmail
s@SendTemplatedEmail' {} Maybe Text
a -> SendTemplatedEmail
s {$sel:returnPathArn:SendTemplatedEmail' :: Maybe Text
returnPathArn = Maybe Text
a} :: SendTemplatedEmail)

-- | 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@.
--
-- For more information about sending authorization, see the
-- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization.html Amazon SES Developer Guide>.
sendTemplatedEmail_sourceArn :: Lens.Lens' SendTemplatedEmail (Prelude.Maybe Prelude.Text)
sendTemplatedEmail_sourceArn :: Lens' SendTemplatedEmail (Maybe Text)
sendTemplatedEmail_sourceArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendTemplatedEmail' {Maybe Text
sourceArn :: Maybe Text
$sel:sourceArn:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe Text
sourceArn} -> Maybe Text
sourceArn) (\s :: SendTemplatedEmail
s@SendTemplatedEmail' {} Maybe Text
a -> SendTemplatedEmail
s {$sel:sourceArn:SendTemplatedEmail' :: Maybe Text
sourceArn = Maybe Text
a} :: SendTemplatedEmail)

-- | A list of tags, in the form of name\/value pairs, to apply to an email
-- that you send using @SendTemplatedEmail@. Tags correspond to
-- characteristics of the email that you define, so that you can publish
-- email sending events.
sendTemplatedEmail_tags :: Lens.Lens' SendTemplatedEmail (Prelude.Maybe [MessageTag])
sendTemplatedEmail_tags :: Lens' SendTemplatedEmail (Maybe [MessageTag])
sendTemplatedEmail_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendTemplatedEmail' {Maybe [MessageTag]
tags :: Maybe [MessageTag]
$sel:tags:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe [MessageTag]
tags} -> Maybe [MessageTag]
tags) (\s :: SendTemplatedEmail
s@SendTemplatedEmail' {} Maybe [MessageTag]
a -> SendTemplatedEmail
s {$sel:tags:SendTemplatedEmail' :: Maybe [MessageTag]
tags = Maybe [MessageTag]
a} :: SendTemplatedEmail) 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 ARN of the template to use when sending this email.
sendTemplatedEmail_templateArn :: Lens.Lens' SendTemplatedEmail (Prelude.Maybe Prelude.Text)
sendTemplatedEmail_templateArn :: Lens' SendTemplatedEmail (Maybe Text)
sendTemplatedEmail_templateArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendTemplatedEmail' {Maybe Text
templateArn :: Maybe Text
$sel:templateArn:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe Text
templateArn} -> Maybe Text
templateArn) (\s :: SendTemplatedEmail
s@SendTemplatedEmail' {} Maybe Text
a -> SendTemplatedEmail
s {$sel:templateArn:SendTemplatedEmail' :: Maybe Text
templateArn = Maybe Text
a} :: SendTemplatedEmail)

-- | The email address that is sending the email. This email address must be
-- either individually verified with Amazon SES, or from a domain that has
-- been verified with Amazon SES. For information about verifying
-- identities, see the
-- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/verify-addresses-and-domains.html Amazon SES Developer Guide>.
--
-- If you are sending on behalf of another user and have been permitted to
-- do so by a sending authorization policy, then you must also specify the
-- @SourceArn@ parameter. For more information about sending authorization,
-- see the
-- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization.html Amazon SES Developer Guide>.
--
-- 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?=@.
sendTemplatedEmail_source :: Lens.Lens' SendTemplatedEmail Prelude.Text
sendTemplatedEmail_source :: Lens' SendTemplatedEmail Text
sendTemplatedEmail_source = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendTemplatedEmail' {Text
source :: Text
$sel:source:SendTemplatedEmail' :: SendTemplatedEmail -> Text
source} -> Text
source) (\s :: SendTemplatedEmail
s@SendTemplatedEmail' {} Text
a -> SendTemplatedEmail
s {$sel:source:SendTemplatedEmail' :: Text
source = Text
a} :: SendTemplatedEmail)

-- | The destination for this email, composed of To:, CC:, and BCC: fields. A
-- Destination can include up to 50 recipients across these three fields.
sendTemplatedEmail_destination :: Lens.Lens' SendTemplatedEmail Destination
sendTemplatedEmail_destination :: Lens' SendTemplatedEmail Destination
sendTemplatedEmail_destination = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendTemplatedEmail' {Destination
destination :: Destination
$sel:destination:SendTemplatedEmail' :: SendTemplatedEmail -> Destination
destination} -> Destination
destination) (\s :: SendTemplatedEmail
s@SendTemplatedEmail' {} Destination
a -> SendTemplatedEmail
s {$sel:destination:SendTemplatedEmail' :: Destination
destination = Destination
a} :: SendTemplatedEmail)

-- | The template to use when sending this email.
sendTemplatedEmail_template :: Lens.Lens' SendTemplatedEmail Prelude.Text
sendTemplatedEmail_template :: Lens' SendTemplatedEmail Text
sendTemplatedEmail_template = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendTemplatedEmail' {Text
template :: Text
$sel:template:SendTemplatedEmail' :: SendTemplatedEmail -> Text
template} -> Text
template) (\s :: SendTemplatedEmail
s@SendTemplatedEmail' {} Text
a -> SendTemplatedEmail
s {$sel:template:SendTemplatedEmail' :: Text
template = Text
a} :: SendTemplatedEmail)

-- | A list of replacement values to apply to the template. This parameter is
-- a JSON object, typically consisting of key-value pairs in which the keys
-- correspond to replacement tags in the email template.
sendTemplatedEmail_templateData :: Lens.Lens' SendTemplatedEmail Prelude.Text
sendTemplatedEmail_templateData :: Lens' SendTemplatedEmail Text
sendTemplatedEmail_templateData = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendTemplatedEmail' {Text
templateData :: Text
$sel:templateData:SendTemplatedEmail' :: SendTemplatedEmail -> Text
templateData} -> Text
templateData) (\s :: SendTemplatedEmail
s@SendTemplatedEmail' {} Text
a -> SendTemplatedEmail
s {$sel:templateData:SendTemplatedEmail' :: Text
templateData = Text
a} :: SendTemplatedEmail)

instance Core.AWSRequest SendTemplatedEmail where
  type
    AWSResponse SendTemplatedEmail =
      SendTemplatedEmailResponse
  request :: (Service -> Service)
-> SendTemplatedEmail -> Request SendTemplatedEmail
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 SendTemplatedEmail
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse SendTemplatedEmail)))
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
"SendTemplatedEmailResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Int -> Text -> SendTemplatedEmailResponse
SendTemplatedEmailResponse'
            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 SendTemplatedEmail where
  hashWithSalt :: Int -> SendTemplatedEmail -> Int
hashWithSalt Int
_salt SendTemplatedEmail' {Maybe [Text]
Maybe [MessageTag]
Maybe Text
Text
Destination
templateData :: Text
template :: Text
destination :: Destination
source :: Text
templateArn :: Maybe Text
tags :: Maybe [MessageTag]
sourceArn :: Maybe Text
returnPathArn :: Maybe Text
returnPath :: Maybe Text
replyToAddresses :: Maybe [Text]
configurationSetName :: Maybe Text
$sel:templateData:SendTemplatedEmail' :: SendTemplatedEmail -> Text
$sel:template:SendTemplatedEmail' :: SendTemplatedEmail -> Text
$sel:destination:SendTemplatedEmail' :: SendTemplatedEmail -> Destination
$sel:source:SendTemplatedEmail' :: SendTemplatedEmail -> Text
$sel:templateArn:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe Text
$sel:tags:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe [MessageTag]
$sel:sourceArn:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe Text
$sel:returnPathArn:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe Text
$sel:returnPath:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe Text
$sel:replyToAddresses:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe [Text]
$sel:configurationSetName:SendTemplatedEmail' :: SendTemplatedEmail -> 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]
replyToAddresses
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
returnPath
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
returnPathArn
      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` Maybe Text
templateArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
source
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Destination
destination
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
template
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
templateData

instance Prelude.NFData SendTemplatedEmail where
  rnf :: SendTemplatedEmail -> ()
rnf SendTemplatedEmail' {Maybe [Text]
Maybe [MessageTag]
Maybe Text
Text
Destination
templateData :: Text
template :: Text
destination :: Destination
source :: Text
templateArn :: Maybe Text
tags :: Maybe [MessageTag]
sourceArn :: Maybe Text
returnPathArn :: Maybe Text
returnPath :: Maybe Text
replyToAddresses :: Maybe [Text]
configurationSetName :: Maybe Text
$sel:templateData:SendTemplatedEmail' :: SendTemplatedEmail -> Text
$sel:template:SendTemplatedEmail' :: SendTemplatedEmail -> Text
$sel:destination:SendTemplatedEmail' :: SendTemplatedEmail -> Destination
$sel:source:SendTemplatedEmail' :: SendTemplatedEmail -> Text
$sel:templateArn:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe Text
$sel:tags:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe [MessageTag]
$sel:sourceArn:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe Text
$sel:returnPathArn:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe Text
$sel:returnPath:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe Text
$sel:replyToAddresses:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe [Text]
$sel:configurationSetName:SendTemplatedEmail' :: SendTemplatedEmail -> 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]
replyToAddresses
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
returnPath
      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
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 Maybe Text
templateArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
source
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Destination
destination
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
template
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
templateData

instance Data.ToHeaders SendTemplatedEmail where
  toHeaders :: SendTemplatedEmail -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

instance Data.ToPath SendTemplatedEmail where
  toPath :: SendTemplatedEmail -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Data.ToQuery SendTemplatedEmail where
  toQuery :: SendTemplatedEmail -> QueryString
toQuery SendTemplatedEmail' {Maybe [Text]
Maybe [MessageTag]
Maybe Text
Text
Destination
templateData :: Text
template :: Text
destination :: Destination
source :: Text
templateArn :: Maybe Text
tags :: Maybe [MessageTag]
sourceArn :: Maybe Text
returnPathArn :: Maybe Text
returnPath :: Maybe Text
replyToAddresses :: Maybe [Text]
configurationSetName :: Maybe Text
$sel:templateData:SendTemplatedEmail' :: SendTemplatedEmail -> Text
$sel:template:SendTemplatedEmail' :: SendTemplatedEmail -> Text
$sel:destination:SendTemplatedEmail' :: SendTemplatedEmail -> Destination
$sel:source:SendTemplatedEmail' :: SendTemplatedEmail -> Text
$sel:templateArn:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe Text
$sel:tags:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe [MessageTag]
$sel:sourceArn:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe Text
$sel:returnPathArn:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe Text
$sel:returnPath:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe Text
$sel:replyToAddresses:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe [Text]
$sel:configurationSetName:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"SendTemplatedEmail" :: 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
"ReplyToAddresses"
          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]
replyToAddresses
            ),
        ByteString
"ReturnPath" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
returnPath,
        ByteString
"ReturnPathArn" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
returnPathArn,
        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
"TemplateArn" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
templateArn,
        ByteString
"Source" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
source,
        ByteString
"Destination" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Destination
destination,
        ByteString
"Template" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
template,
        ByteString
"TemplateData" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
templateData
      ]

-- | /See:/ 'newSendTemplatedEmailResponse' smart constructor.
data SendTemplatedEmailResponse = SendTemplatedEmailResponse'
  { -- | The response's http status code.
    SendTemplatedEmailResponse -> Int
httpStatus :: Prelude.Int,
    -- | The unique message identifier returned from the @SendTemplatedEmail@
    -- action.
    SendTemplatedEmailResponse -> Text
messageId :: Prelude.Text
  }
  deriving (SendTemplatedEmailResponse -> SendTemplatedEmailResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SendTemplatedEmailResponse -> SendTemplatedEmailResponse -> Bool
$c/= :: SendTemplatedEmailResponse -> SendTemplatedEmailResponse -> Bool
== :: SendTemplatedEmailResponse -> SendTemplatedEmailResponse -> Bool
$c== :: SendTemplatedEmailResponse -> SendTemplatedEmailResponse -> Bool
Prelude.Eq, ReadPrec [SendTemplatedEmailResponse]
ReadPrec SendTemplatedEmailResponse
Int -> ReadS SendTemplatedEmailResponse
ReadS [SendTemplatedEmailResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SendTemplatedEmailResponse]
$creadListPrec :: ReadPrec [SendTemplatedEmailResponse]
readPrec :: ReadPrec SendTemplatedEmailResponse
$creadPrec :: ReadPrec SendTemplatedEmailResponse
readList :: ReadS [SendTemplatedEmailResponse]
$creadList :: ReadS [SendTemplatedEmailResponse]
readsPrec :: Int -> ReadS SendTemplatedEmailResponse
$creadsPrec :: Int -> ReadS SendTemplatedEmailResponse
Prelude.Read, Int -> SendTemplatedEmailResponse -> ShowS
[SendTemplatedEmailResponse] -> ShowS
SendTemplatedEmailResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SendTemplatedEmailResponse] -> ShowS
$cshowList :: [SendTemplatedEmailResponse] -> ShowS
show :: SendTemplatedEmailResponse -> String
$cshow :: SendTemplatedEmailResponse -> String
showsPrec :: Int -> SendTemplatedEmailResponse -> ShowS
$cshowsPrec :: Int -> SendTemplatedEmailResponse -> ShowS
Prelude.Show, forall x.
Rep SendTemplatedEmailResponse x -> SendTemplatedEmailResponse
forall x.
SendTemplatedEmailResponse -> Rep SendTemplatedEmailResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SendTemplatedEmailResponse x -> SendTemplatedEmailResponse
$cfrom :: forall x.
SendTemplatedEmailResponse -> Rep SendTemplatedEmailResponse x
Prelude.Generic)

-- |
-- Create a value of 'SendTemplatedEmailResponse' 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', 'sendTemplatedEmailResponse_httpStatus' - The response's http status code.
--
-- 'messageId', 'sendTemplatedEmailResponse_messageId' - The unique message identifier returned from the @SendTemplatedEmail@
-- action.
newSendTemplatedEmailResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'messageId'
  Prelude.Text ->
  SendTemplatedEmailResponse
newSendTemplatedEmailResponse :: Int -> Text -> SendTemplatedEmailResponse
newSendTemplatedEmailResponse
  Int
pHttpStatus_
  Text
pMessageId_ =
    SendTemplatedEmailResponse'
      { $sel:httpStatus:SendTemplatedEmailResponse' :: Int
httpStatus =
          Int
pHttpStatus_,
        $sel:messageId:SendTemplatedEmailResponse' :: Text
messageId = Text
pMessageId_
      }

-- | The response's http status code.
sendTemplatedEmailResponse_httpStatus :: Lens.Lens' SendTemplatedEmailResponse Prelude.Int
sendTemplatedEmailResponse_httpStatus :: Lens' SendTemplatedEmailResponse Int
sendTemplatedEmailResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendTemplatedEmailResponse' {Int
httpStatus :: Int
$sel:httpStatus:SendTemplatedEmailResponse' :: SendTemplatedEmailResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: SendTemplatedEmailResponse
s@SendTemplatedEmailResponse' {} Int
a -> SendTemplatedEmailResponse
s {$sel:httpStatus:SendTemplatedEmailResponse' :: Int
httpStatus = Int
a} :: SendTemplatedEmailResponse)

-- | The unique message identifier returned from the @SendTemplatedEmail@
-- action.
sendTemplatedEmailResponse_messageId :: Lens.Lens' SendTemplatedEmailResponse Prelude.Text
sendTemplatedEmailResponse_messageId :: Lens' SendTemplatedEmailResponse Text
sendTemplatedEmailResponse_messageId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendTemplatedEmailResponse' {Text
messageId :: Text
$sel:messageId:SendTemplatedEmailResponse' :: SendTemplatedEmailResponse -> Text
messageId} -> Text
messageId) (\s :: SendTemplatedEmailResponse
s@SendTemplatedEmailResponse' {} Text
a -> SendTemplatedEmailResponse
s {$sel:messageId:SendTemplatedEmailResponse' :: Text
messageId = Text
a} :: SendTemplatedEmailResponse)

instance Prelude.NFData SendTemplatedEmailResponse where
  rnf :: SendTemplatedEmailResponse -> ()
rnf SendTemplatedEmailResponse' {Int
Text
messageId :: Text
httpStatus :: Int
$sel:messageId:SendTemplatedEmailResponse' :: SendTemplatedEmailResponse -> Text
$sel:httpStatus:SendTemplatedEmailResponse' :: SendTemplatedEmailResponse -> 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