email_octopus

Version, currently 0.3.03 versions

github.com/flucksite/email_octopus

A Crystal wrapper for the EmailOctopus.com API.

1 stars
0 dependents
License: MIT

Installation

# Add this to your shard.yml
dependencies:
  email_octopus:
    github: flucksite/email_octopus
    version: ~> 0.3.0

Then run:

shards install

shard.yml

Crystal
>= 1.10.0
License
MIT
Author
Wout

Dependencies

Development Dependencies

  • ameba*github: crystal-ameba/amebadev
  • webmock*github: manastech/webmock.cr, branch: masterdev

README

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.

  • [X] Client with authentication
  • [X] 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
    • [X] 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