83fce5c
commit 83fce5c
3 files changed
+22 -0
Showing 3 changed files+22-0
▼crates/justapi-core/src/lib.rs
+2-0
| @@ -33,6 +33,8 @@ pub mod tracing_setup; | ||
33 | 33 | pub mod validate; |
34 | 34 | pub mod wasm; |
35 | 35 | pub mod xml; |
36 | +#[cfg(feature = "mail")] | |
37 | +pub mod mail; | |
36 | 38 | |
37 | 39 | pub use server::{serve, Server}; |
38 | 40 | |
39 | 41 | |
▼crates/justapi-core/src/mail/mod.rs
+12-0
| @@ -0,0 +1,12 @@ | ||
1 | +pub mod message; | |
2 | +pub mod otp; | |
3 | +pub mod queue; | |
4 | +pub mod smtp; | |
5 | +pub mod state; | |
6 | +pub mod template; | |
7 | +pub mod types; | |
8 | +pub mod verify; | |
9 | + | |
10 | +pub use message::EmailMessage; | |
11 | +pub use state::{MailerState, SharedMailer}; | |
12 | +pub use types::{Attachment, EmailAddress, SmtpConfig}; | |
0 | 13 | |
▼crates/justapi-py/src/lib.rs
+8-0
| @@ -6,6 +6,10 @@ mod dag; | ||
6 | 6 | mod database; |
7 | 7 | pub mod gil_pool; |
8 | 8 | mod logging; |
9 | +#[cfg(feature = "mail")] | |
10 | +mod mail; | |
11 | +#[cfg(feature = "mail")] | |
12 | +mod message_builder; | |
9 | 13 | mod multipart; |
10 | 14 | mod native; |
11 | 15 | mod rate_limit; |
| @@ -17,6 +21,8 @@ mod websocket; | ||
17 | 21 | |
18 | 22 | pub use dag::{Dag, DagNode}; |
19 | 23 | pub use database::{Database, DbParam, DbPool}; |
24 | +#[cfg(feature = "mail")] | |
25 | +pub use mail::PyMailer; | |
20 | 26 | pub use multipart::UploadFile; |
21 | 27 | pub use native::{validate_value, TokenStreamResponse, ValidatedStreamResponse}; |
22 | 28 | pub use rate_limit::PyRateLimitResult; |
| @@ -76,6 +82,8 @@ fn _justapi(_py: Python<'_>, m: &Bound<'_, PyModule>) -> PyResult<()> { | ||
76 | 82 | m.add_class::<DagNode>()?; |
77 | 83 | m.add_class::<background::BackgroundTasks>()?; |
78 | 84 | m.add_class::<scheduler::PyScheduler>()?; |
85 | + #[cfg(feature = "mail")] | |
86 | + m.add_class::<mail::PyMailer>()?; | |
79 | 87 | status::register(m)?; |
80 | 88 | logging::register(m)?; |
81 | 89 | Ok(()) |
82 | 90 | |