{"id":18552392,"url":"https://github.com/traviswimer/serverless-respat-ses-forwarder","last_synced_at":"2025-05-15T11:12:45.176Z","repository":{"id":147421109,"uuid":"141610305","full_name":"traviswimer/serverless-respat-ses-forwarder","owner":"traviswimer","description":"Resource pattern to setup email forwarding through SES","archived":false,"fork":false,"pushed_at":"2018-07-26T19:33:23.000Z","size":71,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-17T10:49:05.167Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/traviswimer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-07-19T17:19:50.000Z","updated_at":"2018-07-26T19:33:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"9333a022-e6e3-4af6-8aae-615945385314","html_url":"https://github.com/traviswimer/serverless-respat-ses-forwarder","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/traviswimer%2Fserverless-respat-ses-forwarder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/traviswimer%2Fserverless-respat-ses-forwarder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/traviswimer%2Fserverless-respat-ses-forwarder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/traviswimer%2Fserverless-respat-ses-forwarder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/traviswimer","download_url":"https://codeload.github.com/traviswimer/serverless-respat-ses-forwarder/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254328389,"owners_count":22052633,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T21:14:06.939Z","updated_at":"2025-05-15T11:12:40.168Z","avatar_url":"https://github.com/traviswimer.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# serverless-respat-ses-forwarder\n\u003e Resource Pattern for forwarding emails using SES\n\n## Usage\n\nThis package is intended for use with the **serverless-respat plugin**. ([install/usage info](https://github.com/traviswimer/serverless-respat)).\n\nInstall:\n\n`npm install --save-dev serverless-respat-ses-forwarder`\n\nAdd patterns to the \"custom\" object in your serverless config file:\n\n```javascript\n\"custom\": {\n\t\"serverless-respat\": {\n\t\tprefix: \"${self:service}-${opt:stage}\",\n\t\tpatterns: [\n\t\t\t{\n\t\t\t\tpattern: require(\"serverless-respat-ses-forwarder\"),\n\t\t\t\tconfig: {\n\t\t\t\t\tses_ruleset_name: \"EmailForwarding\",\n\t\t\t\t\tbucket_name: \"el-bucket-de-email\",\n\t\t\t\t\temail_recipients: [\"kjsdfjweijfkjsdfhjkhdf.com\"],\n\t\t\t\t\tlambda_function_name: \"ForwardEmail\"\n\t\t\t\t}\n\t\t\t}\n\t\t]\n\t}\n}\n```\n\nAdd a function that does the email forwarding for you. The property name should match the `lambda_function_name` in your plugin config.\n\n```javascript\n\"functions\": {\n\t\"forwardEmail\": {\n\t\t\"handler\": \"handlers.forwardEmail\",\n\t\t\"role\": \"SesForwarderLambdaForwardRole\"\n\t}\n}\n```\n\nThe easiest way to setup a forwarding lambda function is to use [aws-lambda-ses-forwarder](https://github.com/arithmetric/aws-lambda-ses-forwarder). Your `handlers.js` file would then look something like this:\n\n```javascript\nconst ses_forwarder = require('aws-lambda-ses-forwarder');\n\nmodule.exports = {\n\tforwardEmail: (event, context, callback) =\u003e {\n\t\treturn ses_forwarder.handler(event, context, callback, {\n\t\t\tconfig: {\n\t\t\t\tfromEmail: \"noreply@YOUR_DOMAIN\",\n\t\t\t\tsubjectPrefix: \"YOUR_DOMAIN: \",\n\t\t\t\temailBucket: \"YOUR_DOMAIN-email\",\n\t\t\t\temailKeyPrefix: \"\",\n\t\t\t\tforwardMapping: {\n\t\t\t\t\t\"@YOUR_DOMAIN\": [\"YOUR_USERNAME@gmail.com\"]\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n}\n```\n\nMake sure you have verified your email address and domains for SES using the AWS console.\n\n## Config options\n**pattern_name** - (string, _default: \"SesForwarder\"_) A pattern name included in resource names.\n\n**bucket_path** - (string, _default: '/'_) Path to bucket.\n\n**bucket_name** - (string, REQUIRED) The S3 bucket name used to store your emails.\n\n**ses_ruleset_name** - (string, REQUIRED) The active SES ruleset where the receipt rules will be added. The ruleset must already exist.\n\n**email_recipients** - (string, REQUIRED) The email address where you would like the emails to be forwarded.\n\n**lambda_function_name** - (string, REQUIRED) The name of the lambda function that does the forwarding.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftraviswimer%2Fserverless-respat-ses-forwarder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftraviswimer%2Fserverless-respat-ses-forwarder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftraviswimer%2Fserverless-respat-ses-forwarder/lists"}