email_octopus

Version, currently 0.2.03 versions

github.com/flucksite/email_octopus

A Crystal wrapper for the EmailOctopus.com API.

1 stars
0 dependents
License: MIT

Nothing has been indexed for 0.2.0 yet. The tag is recorded, its shard.yml has not been read, so the manifest and dependency list below are empty because they are unknown rather than because they are absent.

Installation

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

Then run:

shards install

shard.yml

No shard.yml has been indexed for 0.2.0. You can read it on the repository.

Dependencies

Unknown: the shard.yml for this version has not been read yet.

README

This README is the one indexed from the repository at its latest ref, not from the tag for this version.

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