2023-09-26 13:55:58 -04:00
# Amazon SES code examples for the SDK for JavaScript (v3)
2022-08-25 08:41:11 -04:00
## Overview
2023-09-26 13:55:58 -04:00
Shows how to use the AWS SDK for JavaScript (v3) to work with Amazon Simple Email Service (Amazon SES).
2022-08-25 08:41:11 -04:00
2023-09-26 13:55:58 -04:00
<!--custom.overview.start-->
<!--custom.overview.end-->
2022-08-25 08:41:11 -04:00
2023-10-02 12:43:28 -04:00
_ Amazon SES is a reliable, scalable, and cost-effective email service. _
2023-09-26 13:55:58 -04:00
## ⚠ Important
2024-01-09 12:33:12 -05:00
* Running this code might result in charges to your AWS account. For more details, see [AWS Pricing ](https://aws.amazon.com/pricing/ ) and [Free Tier ](https://aws.amazon.com/free/ ).
2024-01-04 12:50:33 -05:00
* Running the tests might result in charges to your AWS account.
* We recommend that you grant your code least privilege. At most, grant only the minimum permissions required to perform the task. For more information, see [Grant least privilege ](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#grant-least-privilege ).
* This code is not tested in every AWS Region. For more information, see [AWS Regional Services ](https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services ).
2023-09-26 13:55:58 -04:00
<!--custom.important.start-->
<!--custom.important.end-->
2020-09-30 15:40:42 +01:00
2021-05-18 14:27:10 +01:00
## Code examples
2022-08-25 08:41:11 -04:00
2023-09-26 13:55:58 -04:00
### Prerequisites
For prerequisites, see the [README ](../../README.md#Prerequisites ) in the `javascriptv3` folder.
2024-01-04 12:50:33 -05:00
2023-09-26 13:55:58 -04:00
<!--custom.prerequisites.start-->
<!--custom.prerequisites.end-->
2022-08-25 08:41:11 -04:00
### Single actions
Code excerpts that show you how to call individual service functions.
2024-04-30 12:22:08 -07:00
- [CreateReceiptFilter ](src/ses_createreceiptfilter.js#L16 )
- [CreateReceiptRule ](src/ses_createreceiptrule.js#L17 )
- [CreateReceiptRuleSet ](src/ses_createreceiptruleset.js#L15 )
- [CreateTemplate ](src/ses_createtemplate.js#L16 )
- [DeleteIdentity ](src/ses_deleteidentity.js#L16 )
- [DeleteReceiptFilter ](src/ses_deletereceiptfilter.js#L16 )
- [DeleteReceiptRule ](src/ses_deletereceiptrule.js#L16 )
- [DeleteReceiptRuleSet ](src/ses_deletereceiptruleset.js#L16 )
- [DeleteTemplate ](src/ses_deletetemplate.js#L15 )
- [GetTemplate ](src/ses_gettemplate.js#L15 )
- [ListIdentities ](src/ses_listidentities.js#L15 )
- [ListReceiptFilters ](src/ses_listreceiptfilters.js#L15 )
- [ListTemplates ](src/ses_listtemplates.js#L15 )
- [SendBulkTemplatedEmail ](src/ses_sendbulktemplatedemail.js#L16 )
- [SendEmail ](src/ses_sendemail.js#L16 )
- [SendRawEmail ](src/send-with-attachments.js#L6 )
- [SendTemplatedEmail ](src/ses_sendtemplatedemail.js#L16 )
- [UpdateTemplate ](src/ses_updatetemplate.js#L15 )
- [VerifyDomainIdentity ](src/ses_verifydomainidentity.js#L15 )
- [VerifyEmailIdentity ](src/ses_verifyemailidentity.js#L16 )
2022-08-25 08:41:11 -04:00
2024-01-04 12:50:33 -05:00
<!--custom.examples.start-->
<!--custom.examples.end-->
2022-08-25 08:41:11 -04:00
## Run the examples
2023-09-26 13:55:58 -04:00
### Instructions
2022-08-25 08:41:11 -04:00
2023-09-26 13:55:58 -04:00
**Note ** : All code examples are written in ECMAscript 6 (ES6). For guidelines on converting to CommonJS, see
[JavaScript ES6/CommonJS syntax ](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/sdk-examples-javascript-syntax.html ).
**Run a single action **
``` bash
node ./actions/<fileName>
```
2022-08-25 08:41:11 -04:00
2023-09-26 13:55:58 -04:00
**Run a scenario **
2024-08-28 14:08:16 -04:00
2023-09-26 13:55:58 -04:00
Most scenarios can be run with the following command:
``` bash
node ./scenarios/<fileName>
```
2022-08-25 08:41:11 -04:00
2024-08-28 14:08:16 -04:00
**Run with options **
Some actions and scenarios can be run with options from the command line:
``` bash
node ./scenarios/<fileName> --option1 --option2
```
[util.parseArgs ](https://nodejs.org/api/util.html#utilparseargsconfig ) is used to configure
these options. For the specific options available to each script, see the `parseArgs` usage
for that file.
2023-09-26 13:55:58 -04:00
<!--custom.instructions.start-->
<!--custom.instructions.end-->
2022-08-25 08:41:11 -04:00
2024-01-04 12:50:33 -05:00
2023-09-26 13:55:58 -04:00
### Tests
⚠ Running tests might result in charges to your AWS account.
2024-01-04 12:50:33 -05:00
2023-09-26 13:55:58 -04:00
To find instructions for running these tests, see the [README ](../../README.md#Tests )
in the `javascriptv3` folder.
2024-01-04 12:50:33 -05:00
2023-09-26 13:55:58 -04:00
<!--custom.tests.start-->
<!--custom.tests.end-->
2022-08-25 08:41:11 -04:00
## Additional resources
2023-10-02 12:43:28 -04:00
- [Amazon SES Developer Guide ](https://docs.aws.amazon.com/ses/latest/dg/Welcome.html )
- [Amazon SES API Reference ](https://docs.aws.amazon.com/ses/latest/APIReference/Welcome.html )
- [SDK for JavaScript (v3) Amazon SES reference ](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ses )
2023-09-26 13:55:58 -04:00
<!--custom.resources.start-->
<!--custom.resources.end-->
---
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2022-08-25 08:41:11 -04:00
2024-01-04 12:50:33 -05:00
SPDX-License-Identifier: Apache-2.0