Liking cljdoc? Tell your friends :D

resend.api.emails

Emails resource – wraps the /emails Resend REST endpoints.

Mirrors the interface of the official SDKs (Node, Python, Java, Go, etc.):

emails/send! POST /emails emails/send-batch! POST /emails/batch emails/get! GET /emails/:id emails/update! PATCH /emails/:id emails/cancel! POST /emails/:id/cancel

All functions return {:data <parsed-map> :error nil} on success or {:data nil :error <error-map>} on failure, so callers never need a try/catch for normal API errors. Bang (!) variants throw instead.

References:

Emails resource – wraps the /emails Resend REST endpoints.

Mirrors the interface of the official SDKs (Node, Python, Java, Go, etc.):

  emails/send!        POST   /emails
  emails/send-batch!  POST   /emails/batch
  emails/get!         GET    /emails/:id
  emails/update!      PATCH  /emails/:id
  emails/cancel!      POST   /emails/:id/cancel

All functions return {:data <parsed-map> :error nil} on success or
{:data nil :error <error-map>} on failure, so callers never need a
try/catch for normal API errors. Bang (!) variants throw instead.

References:
- Resend send email API: https://resend.com/docs/api-reference/emails/send-email
raw docstring

resend.core

Public entry point for the resend-clojure SDK.

Most users only need this namespace and the resource namespaces (e.g. resend.emails).

Example: (require '[resend.core :as resend]) (require '[resend.emails :as emails])

(def client (resend/create-client {:api-key (System/getenv "RESEND_API_KEY")}))

(emails/send client {:from "Acme no-reply@acme.com" :to "user@example.com" :subject "Hello" :html "<strong>Hello!</strong>"})

Public entry point for the resend-clojure SDK.

Most users only need this namespace and the resource namespaces
(e.g. resend.emails).

Example:
  (require '[resend.core   :as resend])
  (require '[resend.emails :as emails])

  (def client (resend/create-client {:api-key (System/getenv "RESEND_API_KEY")}))

  (emails/send client
    {:from    "Acme <no-reply@acme.com>"
     :to      "user@example.com"
     :subject "Hello"
     :html    "<strong>Hello!</strong>"})
raw docstring

resend.internal.client

Constructs and holds the SDK client configuration.

Following the pattern used by resend-node, resend-java, and other official SDKs, a single client record is created once (with the API key) and then threaded through every resource namespace call.

Constructs and holds the SDK client configuration.

Following the pattern used by resend-node, resend-java, and other official
SDKs, a single client record is created once (with the API key) and then
threaded through every resource namespace call.
raw docstring

resend.internal.http

Defines the IHttpAdapter protocol and the default hato-based implementation.

Separating transport from business logic allows consumers to inject a MockAdapter in tests or swap in any alternative HTTP client without touching SDK namespaces.

Defines the IHttpAdapter protocol and the default hato-based implementation.

Separating transport from business logic allows consumers to inject a
MockAdapter in tests or swap in any alternative HTTP client without
touching SDK namespaces.
raw docstring

resend.internal.http-mock-adapter

A MockAdapter that avoids real HTTP calls in unit tests.

Pattern: record captures the canned responses you want to return, plus a calls atom that logs every request for assertion.

A MockAdapter that avoids real HTTP calls in unit tests.

Pattern: record captures the canned responses you want to return,
plus a `calls` atom that logs every request for assertion.
raw docstring

resend.internal.response

Converts raw HTTP responses into the {:data … :error …} envelope used by the SDK. Success: 2xx → {:data <kebab-case map> :error nil} Failure: 4xx+ → {:data nil :error <kebab-case map>}

Converts raw HTTP responses into the {:data … :error …} envelope used by the SDK.
Success: 2xx  → {:data <kebab-case map>  :error nil}
Failure: 4xx+ → {:data nil :error <kebab-case map>}
raw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close