Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/lint-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
nodejs_version: [ 18, 20, 22 ]
nodejs_version: [ 20, 22, 24 ]

steps:
- name: Checkout
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,17 @@ http://docs.aws.amazon.com/ses/latest/DeveloperGuide/limits.html

## Set Up

1. Modify the values in the `config` object at the top of `index.js` to specify
1. Modify the values in the `config` object at the top of `index.mjs` to specify
the S3 bucket and object prefix for locating emails stored by SES. Also provide
the email forwarding mapping from original destinations to new destination.

2. In AWS Lambda, add a new function and skip selecting a blueprint.

- Name the function "SesForwarder" and optionally give it a description. Ensure
Runtime is set to Node.js 22.x. (Node.js 18.x and 20.x can also be used.)
Runtime is set to Node.js 24.x. (Node.js 20.x and 22.x can also be used.)

- For the Lambda function code, either copy and paste the contents of
`index.js` into the inline code editor or zip the contents of the repository
`index.mjs` into the inline code editor or zip the contents of the repository
and upload them directly or via S3.

- Ensure Handler is set to `index.handler`.
Expand Down Expand Up @@ -180,7 +180,7 @@ email forwarding.
- `log`: A function that accepts log messages for reporting. By default, this is
set to `console.log`.
- `steps`: An array of functions that should be executed to process and forward
the email. See `index.js` for the default set of steps.
the email. See `index.mjs` for the default set of steps.

See [example](https://github.com/arithmetric/aws-lambda-ses-forwarder/tree/master/example)
for how to provide configuration as overrides.
Expand Down
4 changes: 2 additions & 2 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ export default [
commaDangle: "only-multiline",
}),
{
files: ["**/*.js"],
files: ["**/*.js", "**/*.mjs"],
languageOptions: {
globals: {
...globals.node,
},
sourceType: "commonjs",
sourceType: "module",
},
plugins: {
"@stylistic/js": stylisticJs,
Expand Down
37 changes: 17 additions & 20 deletions example/index.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
var LambdaForwarder = require("aws-lambda-ses-forwarder");
import { createHandler } from "aws-lambda-ses-forwarder";

exports.handler = function(event, context, callback) {
// See aws-lambda-ses-forwarder/index.js for all options.
var overrides = {
config: {
fromEmail: "noreply@example.com",
emailBucket: "s3-bucket-name",
emailKeyPrefix: "emailsPrefix/",
forwardMapping: {
"info@example.com": [
"example.john@example.com",
"example.jen@example.com"
],
"abuse@example.com": [
"example.jim@example.com"
]
}
// See aws-lambda-ses-forwarder/index.mjs for all options.
export const handler = createHandler({
config: {
fromEmail: "noreply@example.com",
emailBucket: "s3-bucket-name",
emailKeyPrefix: "emailsPrefix/",
forwardMapping: {
"info@example.com": [
"example.john@example.com",
"example.jen@example.com"
],
"abuse@example.com": [
"example.jim@example.com"
]
}
};
LambdaForwarder.handler(event, context, callback, overrides);
};
}
});
Loading