Coder Social home page Coder Social logo

lambda-sms's Introduction

โœ‰๏ธ lambda-mailer

AWS Lambda for sending SMS through Twilio. Ready for deployment in 60 seocnds.

This lambda gives your browser (or any client) a backend for sending emails.

Quick Usage

// install node-lambda
npm install -g node-lambda

// clone the lambda and get inside!
git clone https://github.com/eahefnawy/lambda-mailer.git
cd  lambda-mailer

// install dependencies
npm install

// create deployment files (to hold your env vars)
touch .env deploy.env event.json

.env file is used by your local machine for to test and deploy the lambda, deploy.env is used by your lambda function after deployment. So there might be some duplicate env vars.

open .env and fill it with your AWS credentials: (make sure you have proper IAM permissions)

AWS_ENVIRONMENT=dev
AWS_ACCESS_KEY_ID=your_key
AWS_SECRET_ACCESS_KEY=your_secret
AWS_SESSION_TOKEN=your_sesson token (optional)
AWS_ROLE_ARN=your_amazon_role
AWS_REGION=us-east-1
AWS_FUNCTION_NAME=your_lambda_name
AWS_HANDLER=index.handler
AWS_MODE=event
AWS_MEMORY_SIZE=128
AWS_TIMEOUT=60
AWS_DESCRIPTION=your_lambda_description
AWS_RUNTIME=nodejs
CONFIG_FILE=deploy.env

ACCOUNT_SID=XXX
AUTH_TOKEN=XXX

open deploy.env and fill it with your gmail credentials:

ACCOUNT_SID=XXX
AUTH_TOKEN=XXX

open event.json and fill it with the following sample event: (just change the values)

{
  "to": "+16515556677",
  "from": "+14506667788",
  "body": "Lambdas are cool!"
}


now everything is set! Let's test locally!

node-lambda run

You should get an SMS saying Lambdas are cool!. Now let's deploy...

node-lambda deploy

Now you can provide the previous sample event anytime to your lambda, and you should receive the same SMS. Have fun!

lambda-sms's People

Contributors

eahefnawy avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.