Core email processing functions.
Pure functions for preparing, validating, and formatting emails. No side effects - all I/O happens in the shell layer.
Core email processing functions. Pure functions for preparing, validating, and formatting emails. No side effects - all I/O happens in the shell layer.
(add-bcc email bcc-recipients)Add BCC recipients to email (pure function).
Args: email - Email map bcc-recipients - Email address or vector of addresses
Returns: Email map with BCC header added
Add BCC recipients to email (pure function). Args: email - Email map bcc-recipients - Email address or vector of addresses Returns: Email map with BCC header added
(add-cc email cc-recipients)Add CC recipients to email (pure function).
Args: email - Email map cc-recipients - Email address or vector of addresses
Returns: Email map with CC header added
Add CC recipients to email (pure function). Args: email - Email map cc-recipients - Email address or vector of addresses Returns: Email map with CC header added
(add-reply-to email reply-to)Add Reply-To header to email (pure function).
Args: email - Email map reply-to - Reply-to email address
Returns: Email map with Reply-To header added
Add Reply-To header to email (pure function). Args: email - Email map reply-to - Reply-to email address Returns: Email map with Reply-To header added
(email-summary email)Create summary of email for logging/monitoring (pure function).
Args: email - Email map
Returns: Summary map with key fields
Create summary of email for logging/monitoring (pure function). Args: email - Email map Returns: Summary map with key fields
(format-headers headers)Format and normalize email headers (pure function).
Args: headers - Map of header key-value pairs
Returns: Normalized headers map with kebab-case keys
Format and normalize email headers (pure function). Args: headers - Map of header key-value pairs Returns: Normalized headers map with kebab-case keys
(normalize-recipients recipients)Normalize recipients to vector format.
Args: recipients - String or vector of email addresses
Returns: Vector of email addresses
Normalize recipients to vector format. Args: recipients - String or vector of email addresses Returns: Vector of email addresses
(prepare-email email-input email-id now)Prepare email for sending (pure function).
Args: email-input - Map with required keys: :to - Email address or vector of addresses :from - Email address :subject - Email subject :body - Email body Optional keys: :headers - Map of email headers :attachments - Vector of attachment maps :metadata - Map of metadata email-id - UUID generated by shell layer now - Current timestamp generated by shell layer
Returns: Email map with: :id - Generated UUID :to - Normalized vector of recipients :from - From address :subject - Subject line :body - Email body :headers - Normalized headers (if provided) :attachments - Attachments (if provided) :metadata - Metadata (if provided) :created-at - Timestamp of creation
Prepare email for sending (pure function).
Args:
email-input - Map with required keys:
:to - Email address or vector of addresses
:from - Email address
:subject - Email subject
:body - Email body
Optional keys:
:headers - Map of email headers
:attachments - Vector of attachment maps
:metadata - Map of metadata
email-id - UUID generated by shell layer
now - Current timestamp generated by shell layer
Returns:
Email map with:
:id - Generated UUID
:to - Normalized vector of recipients
:from - From address
:subject - Subject line
:body - Email body
:headers - Normalized headers (if provided)
:attachments - Attachments (if provided)
:metadata - Metadata (if provided)
:created-at - Timestamp of creation(valid-email-address? email)Check if string is valid email format (basic RFC 5322).
Args: email - Email address string
Returns: true if valid email format, false otherwise
Check if string is valid email format (basic RFC 5322). Args: email - Email address string Returns: true if valid email format, false otherwise
(validate-email email)Validate complete email structure (pure function).
Args: email - Email map
Returns: Map with: :valid? - Boolean indicating validity :errors - Vector of error messages (if invalid)
Validate complete email structure (pure function).
Args:
email - Email map
Returns:
Map with:
:valid? - Boolean indicating validity
:errors - Vector of error messages (if invalid)(validate-recipients recipients)Validate recipient email addresses (pure function).
Args: recipients - Vector of email address strings or single email string
Returns: Map with: :valid? - Boolean indicating if all emails are valid :valid-emails - Vector of valid email addresses :invalid-emails - Vector of invalid email addresses
Validate recipient email addresses (pure function).
Args:
recipients - Vector of email address strings or single email string
Returns:
Map with:
:valid? - Boolean indicating if all emails are valid
:valid-emails - Vector of valid email addresses
:invalid-emails - Vector of invalid email addressescljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |