Reference doc for the `sst.aws.Email` component.
The Email
component lets you send emails in your app.
It uses Amazon Simple Email Service.
You can configure it to send emails from a specific email address or from any email addresses in a domain.
By default, new AWS SES accounts are in the sandbox mode and can only send email to verified email addresses and domains. It also limits your account has to a sending quota. To remove these restrictions, you need to request production access.
Sending from an email address
For using an email address as the sender, you need to verify the email address.
Sending from a domain
When you use a domain as the sender, you’ll need to verify that you own the domain.
Configuring DMARC
Link to a resource
You can link it to a function or your Next.js app to send emails.
Now in your function you can use the AWS SES SDK to send emails.
Constructor
Parameters
-
name
string
-
args
EmailArgs
-
opts?
ComponentResourceOptions
EmailArgs
dmarc?
Type Input
<
string
>
Default “v=DMARC1; p=none;“
The DMARC policy for the domain. This’ll create a DNS record with the given DMARC policy.
Only specify this if you are using a domain name as the sender
.
dns?
Type Input
<
false
|
sst.aws.dns
|
sst.cloudflare.dns
|
sst.vercel.dns
>
Default sst.aws.dns
The DNS adapter you want to use for managing DNS records. Only specify this if you
are using a domain name as the sender
.
Specify the hosted zone ID for the domain.
Domain is hosted on Cloudflare.
sender
Type Input
<
string
>
The email address or domain name that you want to send emails from.
Using an email address as the sender. You’ll need to verify the email address. When you deploy your app, you will receive an email from AWS SES with a link to verify the email address.
Using a domain name as the sender. You’ll need to verify that you own the domain. Once you verified, you can send emails from any email addresses in the domain.
To verify the domain, you need to add the verification records to your domain’s DNS.
This can be done automatically for the supported dns
adapters.
If the domain is hosted on Cloudflare.
transform?
transform.identity?
Type EmailIdentityArgs
|
(
args
:
EmailIdentityArgs
=>
void
)
Transform the SES identity resource.
Properties
nodes
nodes.identity
Type EmailIdentity
The Amazon SES identity.
sender
Type Output
<
string
>
The sender email address or domain name.
SDK
The following are accessible through the SDK at runtime.
sender
Type string
The sender email address or domain name.