Skip to the documentation
Ruby

Changelog

Every release of the gem, newest first.

0.0.1

The first release. It covers the whole TypeScript SDK as it stood when this release was cut, 0.0.8 plus the changes queued after it: 430 methods in 41 namespaces, each under the TypeScript name in snake_case, and every one of them sends byte for byte the request its TypeScript twin sends.

  • OpenEmail::Client has a reader for every namespace, from emails, threads and templates to provider_imports, dns_connections and account. listAll is list_all, getActive is get_active, and tempMail is temp_mail.
  • A request body goes in as keyword arguments or as one Hash, and its keys keep the API’s camelCase names. A response comes back as a Hash with Symbol keys.
  • Every paginated resource has list, which returns one OpenEmail::Page, list_all, which returns every item as an Array, and iterate, which yields each item to a block or returns an Enumerator that fetches the next page only when it gets there. PeoplePage, TempMessagesPage, AddressBookPage, AddressBook, BatchResult and TemplateSends carry the answers that hold more than a list.
  • An API refusal raises OpenEmail::ApiError or its subclass for the error type, with status, type, code, param, doc_url, request_id, retry_after_seconds, fields and body, and predicates such as validation? and step_up_required?. No response at all raises OpenEmail::NetworkError, with timeout? when the deadline passed. A mistake in the call itself raises ArgumentError before anything is sent.
  • OpenEmail.create_client builds a client from OPENEMAIL_API_KEY, OPENEMAIL_ACCESS_TOKEN and OPENEMAIL_BASE_URL, and OpenEmail.init, OpenEmail.client and OpenEmail.reset_client manage one shared client that OpenEmail.emails and every other namespace reach through. OpenEmail.create_temp_mail opens disposable inboxes with no credential.
  • access_token: takes an OAuth access token, or anything that responds to call and returns one, called before every request. Every method takes api_key: to act with another key for one call, and the temp_mail methods take inbox_token:.
  • OpenEmail.verify_webhook_signature checks a delivery in constant time, refuses one more than five minutes old and returns the parsed event. It reads the signature from a Hash in any case, a Rack env or Rails’ request.headers.
  • OpenEmail.to_base64, api_key?, access_token?, sealed?, resolve_language, language_by_code and rtl_language? are the helpers of the TypeScript SDK, and every value set its package root exports is a frozen Hash on OpenEmail.
  • It has no runtime dependencies. Requests go through Net::HTTP with a pool of kept-alive connections that one client shares across threads and rebuilds after a fork, and timeout: bounds a whole attempt.
  • Reads, sends and every write that is safe to repeat are retried on 408, 500, 502, 503 and 504 with backoff, and on a 429 only when its Retry-After is a minute or less. Every send carries an idempotency key that its retries reuse.
  • The client refuses to send a credential over plain http: to anything but this machine, refuses a base_url on 0.0.0.0, refuses a header that would split a request, and never lets raw.request leave the base URL’s origin.