email_octopus

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

  1. Add the dependency to your shard.yml:
dependencies:
  email_octopus:
    codeberg: fluck/email_octopus
  1. 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.

  • Client with authentication
  • Exceptions
  • Reties for rate limiting
  • Pagination
  • Automation
    • post Start an automation for a contact
  • Campaign
    • get Get all Campaigns
    • get Get Campaign
    • get Campaign contact reports
    • get Campaign links report
    • get Campaign summary report
  • Contact
    • get Get contacts
    • put Create or update contact
    • post Create contact
    • put Update multiple list contacts
    • get Get contact
    • put Update contact
    • delete Delete contact
  • Field
    • post Create field
    • put Update field
    • delete Delete field
  • List
    • get Get all lists
    • post Create list
    • get Get list
    • put Update list
    • delete Delete list
  • Tag
    • get Get all tags
    • post Create tag
    • put Update tag
    • delete Delete tag

I will complete the work over the following months, but if you feel inclined to help out, I'll happily accept PRs.

Contributing

  1. Fork it (https://codeberg.org/fluck/email_octopus/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

  • Wout - creator and maintainer
Repository

email_octopus

Owner
Statistic
  • 1
  • 0
  • 0
  • 0
  • 2
  • 12 days ago
  • October 7, 2025
License

MIT License

Links
Synced at

Thu, 30 Oct 2025 00:12:41 GMT

Languages