Giter Site home page Giter Site logo

email_worker's Introduction

email_worker

Sends an email via your favorite email/smtp service, ie: Sengrid.

Quick Start

First off, you need an Iron.io account, if you don't have one go sign up for a free account.

Second, you need to have your iron.json file setup.

Now you can get cracking!

1. Add this worker to your account

First install the iron_worker_ng gem:

$ gem install iron_worker_ng

From the command line:

$ iron_worker upload https://github.com/treeder/email_worker/blob/master/email.worker

2. Start using it!

You can queue up tasks for it in any language. Check out our Client Libraries in the language of your choice to make it easy, but here's an example using curl:

$ curl -d '{"tasks": [{"code_name": "email", "payload": "{ \"host\": \"smtp.sendgrid.net\", \"domain\": \"MY DOMAIN eg: yahoo.com\", \"port\": 587, \"username\": \"MY USERNAME\", \"password\": \"MY PASSWORD\", \"from\": \"MY EMAIL\", \"to\": \"MY EMAIL\", \"subject\": \"SUBJECT\", \"body\": \"BODY\" }"}]}' --header "Authorization: OAuth YOUR_TOKEN" --header "Content-Type: application/json" https://worker-aws-us-east-1.iron.io/2/projects/YOUR_PROJECT_ID/tasks

Now go look at HUD to see the task and the log.

And here's how to queue up tasks using Ruby (from enqueue.rb):

require 'iron_worker_ng'
client = IronWorkerNG::Client.new()
client.tasks.create(
    'email', {
        host: "smtp.sendgrid.net",
        domain: "MY DOMAIN eg: iron.io",
        port: 587,
        username: "MY USERNAME",
        password: "MY PASSWORD",
        from: "MY EMAIL",
        to: "EMAIL TO SEND TO",
        subject: "SUBJECT",
        body: "BODY"
    }
)

For clients in other languages, see the Iron.io Dev Center.

email_worker's People

Contributors

treeder avatar

Watchers

James Cloos avatar Stephen Nguyen avatar  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.