wedsonlima / ractive_campaign

Ruby API wrapper for ActiveCampaign API v3

Home Page:https://rubygems.org/gems/ractive_campaign

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Gem Version Maintainability Test Coverage

RactiveCampaign

Ruby API wrapper for ActiveCampaign API v3

Installation

Add this line to your application's Gemfile:

gem "ractive_campaign"

And then execute:

$ bundle install

Or install it yourself as:

$ gem install ractive_campaign

Usage

Config

# config/initializers/ractive_campaign.rb

ActiveCampaign.configure do |config|
  config.api_url = ENV["AC_API_URL"] # ex.: https://mystartup.api-us1.com/api/3
  config.api_key = ENV["AC_API_KEY"]
end

Examples

Contact

# new
harry = ActiveCampaign::Contact.new firstName: "Harry",
                                    lastName: "Potter",
                                    email: "potter.hurray@hogwash.com"
harry.save

# create
hermione = ActiveCampaign::Contact.new firstName: "Hermione",
                                       lastName: "Granger",
                                       email: "mione@drtooth.com"

# update
ron = ActiveCampaign::Contact.create email: "ron1988@hogwash.com", lastName: "Weasley"
ron.firstName = "Ron"
ron.save

Tag

ActiveCampaign::Tag.create tag: "hogwarts"

Contact tags

harry = ActiveCampaign::Contact.find_by email: "potter.hurray@hogwash.com"

# add a contact tag
harry.add_tag "hogwargs"

# remove a tag
harry.remove_tag "hogwarts"

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/wedsonlima/ractive_campaign. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the RactiveCampaign project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

About

Ruby API wrapper for ActiveCampaign API v3

https://rubygems.org/gems/ractive_campaign

License:MIT License


Languages

Language:Ruby 99.3%Language:Shell 0.7%