Skip to content

Instantly share code, notes, and snippets.

@daveworth
Created January 3, 2012 22:10
Show Gist options
  • Select an option

  • Save daveworth/1557203 to your computer and use it in GitHub Desktop.

Select an option

Save daveworth/1557203 to your computer and use it in GitHub Desktop.
An example campaign creator
require 'gibbon'
class CampaignTest
def self.notify
gibbon = Gibbon.new('my api key')
gibbon.throws_exceptions = true
gibbon.campaign_create({
:type => 'regular',
:options => ({
:list_id => 'a list id',
:subject => 'A beautiful subject',
:from_email => 'dave@highgroove.com',
:from_name => 'highgroovedave',
:to_name => '*|FNAME|* *|LNAME|*',
:title => 'A new title',
:auto_tweet => false
}),
:content => ({
:url => 'http://highgroove.com'
})
})
end
end
if __FILE__ == $0
CampaignTest.notify
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment