Class: Smartbill::Sdk::Contracts::EmailContract
- Inherits:
-
Base
- Object
- Dry::Validation::Contract
- Base
- Smartbill::Sdk::Contracts::EmailContract
- Defined in:
- lib/smartbill/sdk/contracts/email_contract.rb
Overview
Validation contract for Models::EmailDocument (+POST /document/send+).
Validates type (factura / proforma) and a basic shape check on the recipient addresses. subject and body_text must be Base64-encoded by the caller — this contract does not verify the encoding.
Constant Summary collapse
- DOCUMENT_TYPES =
%w[factura proforma].freeze
- EMAIL_REGEX =
Very permissive e-mail shape check — the SmartBill API does the authoritative validation.
/\A[^@\s]+@[^@\s]+\z/