Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wedsonlima/ractive_campaign
Ruby API wrapper for ActiveCampaign API v3
https://github.com/wedsonlima/ractive_campaign
activecampaign activecampaign-api rails ruby
Last synced: 3 months ago
JSON representation
Ruby API wrapper for ActiveCampaign API v3
- Host: GitHub
- URL: https://github.com/wedsonlima/ractive_campaign
- Owner: wedsonlima
- License: mit
- Created: 2021-11-10T13:30:20.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-08-29T16:22:51.000Z (5 months ago)
- Last Synced: 2024-09-27T16:21:36.774Z (4 months ago)
- Topics: activecampaign, activecampaign-api, rails, ruby
- Language: Ruby
- Homepage: https://rubygems.org/gems/ractive_campaign
- Size: 70.3 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
[![Gem Version](https://badge.fury.io/rb/ractive_campaign.svg)](https://badge.fury.io/rb/ractive_campaign) [![Maintainability](https://api.codeclimate.com/v1/badges/c23221fc334b63af9a07/maintainability)](https://codeclimate.com/github/wedsonlima/ractive_campaign/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/c23221fc334b63af9a07/test_coverage)](https://codeclimate.com/github/wedsonlima/ractive_campaign/test_coverage)
# RactiveCampaign
Ruby API wrapper for ActiveCampaign API v3
## Installation
Add this line to your application's Gemfile:
```ruby
gem "ractive_campaign"
```And then execute:
$ bundle install
Or install it yourself as:
$ gem install ractive_campaign
## Usage
### Config
```ruby
# config/initializers/ractive_campaign.rbActiveCampaign.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
```ruby
# new
harry = ActiveCampaign::Contact.new firstName: "Harry",
lastName: "Potter",
email: "[email protected]"
harry.save# create
hermione = ActiveCampaign::Contact.new firstName: "Hermione",
lastName: "Granger",
email: "[email protected]"# update
ron = ActiveCampaign::Contact.create email: "[email protected]", lastName: "Weasley"
ron.firstName = "Ron"
ron.save
```#### Tag
```ruby
ActiveCampaign::Tag.create tag: "hogwarts"
```#### Contact tags
```ruby
harry = ActiveCampaign::Contact.find_by email: "[email protected]"# 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](https://github.com/[USERNAME]/ractive_campaign/blob/master/CODE_OF_CONDUCT.md).
## License
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
## 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](https://github.com/[USERNAME]/ractive_campaign/blob/master/CODE_OF_CONDUCT.md).