1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
//! Email sending with multiple backends and template support
//!
//! This module provides a flexible email system with:
//! - Multiple backends (SMTP, AWS SES, console/development)
//! - Askama template integration for HTML and plain text emails
//! - Background job integration for async sending
//! - Common email flows (welcome, verification, password reset)
//!
//! # Examples
//!
//! ## Sending a simple email
//!
//! ```rust,no_run
//! use acton_htmx::email::{Email, SmtpBackend};
//!
//! # async fn example() -> Result<(), Box<dyn std::error::Error>> {
//! let backend = SmtpBackend::from_env()?;
//!
//! let email = Email::new()
//! .to("user@example.com")
//! .from("noreply@myapp.com")
//! .subject("Welcome!")
//! .text("Welcome to our app!")
//! .html("<h1>Welcome to our app!</h1>");
//!
//! backend.send(email).await?;
//! # Ok(())
//! # }
//! ```
//!
//! ## Using email templates
//!
//! ```rust,no_run
//! use acton_htmx::email::{Email, EmailTemplate};
//! use askama::Template;
//!
//! #[derive(Template)]
//! #[template(path = "emails/welcome.html")]
//! struct WelcomeEmail {
//! name: String,
//! verification_url: String,
//! }
//!
//! # async fn example() -> Result<(), Box<dyn std::error::Error>> {
//! let template = WelcomeEmail {
//! name: "Alice".to_string(),
//! verification_url: "https://app.example.com/verify/abc123".to_string(),
//! };
//!
//! let email = Email::from_template(&template)?
//! .to("alice@example.com")
//! .from("noreply@myapp.com")
//! .subject("Welcome to Our App!");
//!
//! # Ok(())
//! # }
//! ```
pub use ;
pub use Email;
pub use EmailError;
pub use SendEmailJob;
pub use EmailSender;
pub use ;
// Test utilities are now in the testing module
// Re-export for backward compatibility
pub use crateMockEmailSender;