github.com/flucksite/email_octopus
0.3.0 / published Oct 18, 2025 / repository
A Crystal wrapper for the EmailOctopus.com API.
email_octopus
A Crystal wrapper for the EmailOctopus AI.
Note The original repository is hosted at https://codeberg.org/fluck/email_octopus.
Installation
- Add the dependency to your
shard.yml:
dependencies:
email_octopus:
codeberg: fluck/email_octopus
- Run
shards install
Usage
Add the shard to your app:
require "email_octopus"
Subscribe a user to an existing list:
contact = EmailOctopus::Contact.create_or_update(
list_id: "00000000-0000-0000-0000-000000000000",
email_address: "otto@example.com",
tags: {
"early-bird" => true
},
)
This will expect the EMAIL_OCTOPUS_API_KEY env var to be set. Alternatively,
you can create a client explicitly:
@client = EmailOctopus::Client.new("eo_api_key")
And pass in the client along with the other arguments:
contact = EmailOctopus::Contact.create_or_update(
list_id: "00000000-0000-0000-0000-000000000000",
email_address: "otto@example.com",
client: @client,
)
To-do
This shard is still a work in progress and far from feature complete. The basics are there to make API calls, but not all resources are implemented yet.
- [X] Client with authentication
- [X] Exceptions
- [ ] Reties for rate limiting
- [ ] Pagination
- Automation
- [ ]
postStart an automation for a contact
- [ ]
- Campaign
- [ ]
getGet all Campaigns - [ ]
getGet Campaign - [ ]
getCampaign contact reports - [ ]
getCampaign links report - [ ]
getCampaign summary report
- [ ]
- Contact
- [ ]
getGet contacts - [X]
putCreate or update contact - [ ]
postCreate contact - [ ]
putUpdate multiple list contacts - [ ]
getGet contact - [ ]
putUpdate contact - [ ]
deleteDelete contact
- [ ]
- Field
- [ ]
postCreate field - [ ]
putUpdate field - [ ]
deleteDelete field
- [ ]
- List
- [ ]
getGet all lists - [ ]
postCreate list - [ ]
getGet list - [ ]
putUpdate list - [ ]
deleteDelete list
- [ ]
- Tag
- [ ]
getGet all tags - [ ]
postCreate tag - [ ]
putUpdate tag - [ ]
deleteDelete tag
- [ ]
I will complete the work over the following months, but if you feel inclined to help out, I'll happily accept PRs.
Contributing
- Fork it (https://codeberg.org/fluck/email_octopus/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- Wout - creator and maintainer