{"id":13989662,"url":"https://github.com/adnanrahic/lambda-mailer","last_synced_at":"2025-09-14T04:30:39.054Z","repository":{"id":89857975,"uuid":"140978466","full_name":"adnanrahic/lambda-mailer","owner":"adnanrahic","description":"Simple module for receiving an email from a contact form on your website.","archived":false,"fork":false,"pushed_at":"2018-07-21T16:05:38.000Z","size":43,"stargazers_count":82,"open_issues_count":1,"forks_count":11,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-08-09T09:42:59.153Z","etag":null,"topics":["aws","aws-lambda","aws-ses","aws-ses-transport","no-dependencies","node-module","nodejs","serverless","serverless-framework"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/lambda-mailer","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/adnanrahic.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-14T21:14:06.000Z","updated_at":"2024-08-10T12:11:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"83ceea11-fab5-4e97-8425-179d5dc12726","html_url":"https://github.com/adnanrahic/lambda-mailer","commit_stats":{"total_commits":29,"total_committers":1,"mean_commits":29.0,"dds":0.0,"last_synced_commit":"b92c4c6ca269031c09facf9e4f5ee86f1ab9ec72"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/adnanrahic/lambda-mailer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adnanrahic%2Flambda-mailer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adnanrahic%2Flambda-mailer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adnanrahic%2Flambda-mailer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adnanrahic%2Flambda-mailer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adnanrahic","download_url":"https://codeload.github.com/adnanrahic/lambda-mailer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adnanrahic%2Flambda-mailer/sbom","scorecard":{"id":167053,"data":{"date":"2025-08-11","repo":{"name":"github.com/adnanrahic/lambda-mailer","commit":"b92c4c6ca269031c09facf9e4f5ee86f1ab9ec72"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 0/25 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 6 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"27 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-mg85-8mv5-ffjr","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-rq8g-5pc5-wrhr","Warn: Project is vulnerable to: GHSA-7hx8-2rxv-66xv","Warn: Project is vulnerable to: GHSA-c429-5p7v-vgjp","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-pppg-cpfq-h7wr","Warn: Project is vulnerable to: GHSA-hw8r-x6gr-5gjp","Warn: Project is vulnerable to: GHSA-8cf7-32gw-wr33","Warn: Project is vulnerable to: GHSA-hjrf-2m68-5959","Warn: Project is vulnerable to: GHSA-qwph-4952-7xr6","Warn: Project is vulnerable to: GHSA-4xc9-xhrj-v574","Warn: Project is vulnerable to: GHSA-x5rq-j2xg-h7qm","Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-8hfj-j24r-96c4","Warn: Project is vulnerable to: GHSA-wc69-rhjr-hc9g","Warn: Project is vulnerable to: GHSA-h97f-5258-5593","Warn: Project is vulnerable to: GHSA-2mvq-xp48-4c77","Warn: Project is vulnerable to: GHSA-5854-jvxx-2cg9","Warn: Project is vulnerable to: GHSA-g64q-3vg8-8f93"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-16T15:11:52.209Z","repository_id":89857975,"created_at":"2025-08-16T15:11:52.209Z","updated_at":"2025-08-16T15:11:52.209Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274965705,"owners_count":25382718,"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","status":"online","status_checked_at":"2025-09-13T02:00:10.085Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["aws","aws-lambda","aws-ses","aws-ses-transport","no-dependencies","node-module","nodejs","serverless","serverless-framework"],"created_at":"2024-08-09T13:01:55.477Z","updated_at":"2025-09-14T04:30:38.831Z","avatar_url":"https://github.com/adnanrahic.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"![dependencies](https://img.shields.io/badge/dependencies-0-brightgreen.svg)\n![contributors](https://img.shields.io/badge/contributors-1-blue.svg)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n![license](https://img.shields.io/badge/eslint-standard-yellowgreen.svg)\n\n\u003cimg src=\"https://raw.githubusercontent.com/adnanrahic/cdn/master/lambda-mailer/lambda-mailer.png\" alt=\"cover\" width=\"100%\"\u003e\n\n# Lambda Mailer\nSimple module for receiving an email from a contact form on your website.\n\n# Note!\n**Module needs Node.js version 8 or above.**\n\n## Usage\nConfiguration is rather simple. \n\n#### 1. Enable your email address in the AWS console -\u003e Simple Email Service\n#### 2. Install the module\n```bash\n$ npm i lambda-mailer\n```\n#### 3. `require()` it in your `handler.js`\n```js\n// define the options for your email and domain\nconst options = {\n  myEmail: process.env.EMAIL, // myEmail is the email address you enabled in AWS SES in the AWS Console\n  myDomain: process.env.DOMAIN // add the domain of your website or '*' if you want to accept requests from any domain\n}\n\n// initialize the function\nconst { sendJSON, sendFormEncoded } = require('lambda-mailer')(options)\n\n// Content-Type: application/json\n// The event.body needs to be a JSON object with 3 properties\n// - email\n// - name\n// - content\nmodule.exports.sendJSON = sendJSON\n\n// Content-Type: application/x-www-form-urlencoded\n// The event.body needs to a URI encoded string with 3 parameters\n// - email\n// - name\n// - content\nmodule.exports.sendFormEncoded = sendFormEncoded\n\n```\n#### 4. Hook it up to API Gateway in the `serverless.yml`\n```yaml\nservice: lambda-mailer\n\ncustom:\n  secrets: ${file(secrets.json)}\n\nprovider:\n  name: aws\n  runtime: nodejs8.10\n  stage: ${self:custom.secrets.NODE_ENV}\n  region: us-east-1\n  profile: ${self:custom.secrets.PROFILE}\n  environment: \n    NODE_ENV: ${self:custom.secrets.NODE_ENV}\n    EMAIL: ${self:custom.secrets.EMAIL}\n    DOMAIN: ${self:custom.secrets.DOMAIN}\n  iamRoleStatements:\n    - Effect: \"Allow\"\n      Action:\n        - \"ses:SendEmail\"\n      Resource: \"*\"\n\nfunctions:\n  sendJSON:\n    handler: handler.sendJSON\n    events:\n      - http:\n          path: email/send/json\n          method: post\n          cors: true\n  sendFormEncoded:\n    handler: handler.sendFormEncoded\n    events:\n      - http:\n          path: email/send/formencoded\n          method: post\n          cors: true\n```\n\n#### 5. Send an HTTP request to the API Gateway endpoint\n\nSend a POST request of the type JSON with the body as stated below. The sample below is with CURL.\n\n- request method: **POST**\n- request body type: **application/json**\n- request body: **{ email: String, name: String, content: String }**\n\n```bash\ncurl --header \"Content-Type: application/json\" \\\n  --request POST \\\n  --data '{\"email\":\"john.doe@email.com\",\"name\":\"John Doe\",\"content\":\"I need some help!\"}' \\\n  https://{id}.execute-api.{region}.amazonaws.com/{stage}/email/send/json\n```\n\n#### 6. Send a regular form POST request to the API Gateway endpoint\n\nSend a POST request using an HTML form. Sample below shows a simple HTML form.\n\n```html\n\u003cform action=\"https://{id}.execute-api.{region}.amazonaws.com/{stage}/dev/email/send/formencoded\" method=\"POST\"\u003e\n  \u003cinput type=\"text\" name=\"name\" required\u003e\n  \u003cinput type=\"email\" name=\"email\" required\u003e\n  \u003ctextarea name=\"content\" required\u003e\u003c/textarea\u003e\n\u003c/form\u003e\n```\n\nBy default the request will redirect back to the initial page the request was sent from. You can edit the `redirectUrl` by adding it as a query string parameter. Example below.\n\n```html\n\u003cform action=\"https://{id}.execute-api.{region}.amazonaws.com/{stage}/dev/email/send/formencoded?redirectUrl=https://someotherdomain.com\" method=\"POST\"\u003e\n  \u003cinput type=\"text\" name=\"name\" required\u003e\n  \u003cinput type=\"email\" name=\"email\" required\u003e\n  \u003ctextarea name=\"content\" required\u003e\u003c/textarea\u003e\n\u003c/form\u003e\n```\n\n---\n\nEnjoy using the module. Feel free to open issues or feature requests. :smile:","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadnanrahic%2Flambda-mailer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadnanrahic%2Flambda-mailer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadnanrahic%2Flambda-mailer/lists"}