Skip to main content

Crate atrg_email

Crate atrg_email 

Source
Expand description

SMTP email sending and OTP verification for at-rust-go.

Provides async email delivery via SMTP and a two-step OTP verification flow for institution/organization membership verification.

When SMTP is not configured, OTPs are logged to stdout (dev mode).

Re-exports§

pub use config::EmailConfig;
pub use otp::generate_otp;
pub use otp::send_otp;
pub use otp::verify_otp;
pub use send::send_email;

Modules§

config
Email configuration.
otp
OTP generation, storage, and verification.
send
SMTP email delivery.

Constants§

CREATE_OTP_TABLE_POSTGRES
SQL for creating the OTP codes table (PostgreSQL).
CREATE_OTP_TABLE_SQLITE
SQL for creating the OTP codes table (SQLite).

Functions§

validate_domain
Validate that an email domain is in the allowed list. Returns Ok(()) if allowed, Err with a message if not.