This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
worker_client.schedules.create('SendInsanity', | |
{ | |
:number => number, | |
:config => worker_client.api.options | |
}, | |
{ | |
:start_at => Time.now, | |
:run_times => 5, | |
:run_every => 60 | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://worker-aws-us-east-1.iron.io/2/projects/{PROJECT_ID}/tasks/webhook?code_name=TwilioWebhook&oauth={TOKEN} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"token":"YOUR_TOKEN", | |
"project_id":"YOUR_PROJECT_ID" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sendgrid: | |
address: "smtp.sendgrid.net" | |
port: '25' | |
authentication: :plain | |
domain: | |
user_name: | |
password: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# We included ActionMailer and our mailer models in the code package | |
# in the last step, but we still need to require them in our worker file. | |
require 'active_support/core_ext' | |
require 'action_mailer' | |
require 'models/mailer' | |
# Parse our config yaml file | |
config = YAML.load_file("settings.yml") | |
# A nifty Ruby line to set the AM settings from our loaded yaml file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
runtime "ruby" | |
# Naming our worker (this is an arbitrary string, we like camelcasing) | |
name "IronMailer" | |
# The actual worker file to execute | |
exec "iron_mailer.rb" | |
# Merging all of our Rails apps models | |
dir '../app/models' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Hello from Iron.io! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head><title></title></head> | |
<body> | |
<%= yield %> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Mailer < ActionMailer::Base | |
layout 'email' | |
default :from => "[email protected]" | |
def hello_world(email) | |
mail(:to => email, | |
:subject => "Hello World from IronWorker!") | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IronMQ::Client.new(:host => 'rackspace') | |
IronMQ::Client.new(:host => 'aws') | |
IronMQ::Client.new(:host => 'my_private_cloud') |