Skip to content

Commit

Permalink
Update development dependencies and code documentation
Browse files Browse the repository at this point in the history
- The 'wiremock' dependency has been added to the development dependencies in the Cargo.toml file.
- The 'BSD-3-Clause' license has been added to the accept list in the deny.toml file.
- The condition for using certain features in the lib.rs file has been adjusted to include the 'default' feature.
- The documentation for various email clients has been updated to include conditionals for different features in the clients/mod.rs file.
  • Loading branch information
amritghimire committed Apr 28, 2024
1 parent efcb864 commit 5ed4cae
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ wiremock = "0.6.0"

[package.metadata.cargo-udeps.ignore]
normal = ["log"]
development = ["tokio-test"]
development = ["tokio-test", "wiremock"]

# docs.rs-specific configuration
[package.metadata.docs.rs]
Expand Down
1 change: 1 addition & 0 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ allow = [
"MIT",
"Apache-2.0",
"Unicode-DFS-2016",
"BSD-3-Clause",
"0BSD"
#"Apache-2.0 WITH LLVM-exception",
]
Expand Down
23 changes: 16 additions & 7 deletions src/clients/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,42 +46,49 @@ pub mod mailersend;
/// To integrate SMTP email client:
///
///```rust
/// # #[cfg(feature = "smtp")]{
/// use email_clients::clients::EmailClient;
/// use email_clients::clients::smtp::{SmtpClient, SmtpConfig};
///let config = SmtpConfig::default();
///let smtp_email_client = EmailClient::Smtp(SmtpClient::new(config));
/// let config = SmtpConfig::default();
/// let smtp_email_client = EmailClient::Smtp(SmtpClient::new(config));
/// # }
///```
///
///To integrate Terminal email client:
///
///```rust
///# use email_clients::clients::EmailClient;
/// # #[cfg(feature = "terminal")]{
/// use email_clients::clients::EmailClient;
/// use email_clients::configuration::EmailConfiguration::Terminal;
///# use email_clients::clients::terminal::{TerminalClient, TerminalConfig};
///let config = TerminalConfig::default() ;
///let terminal_email_client = EmailClient::Terminal(TerminalClient::new(config));
/// use email_clients::clients::terminal::{TerminalClient, TerminalConfig};
/// let config = TerminalConfig::default() ;
/// let terminal_email_client = EmailClient::Terminal(TerminalClient::new(config));
/// # }
///```
///
///To integrate Memory email client:
///
///```rust
/// # #[cfg(feature = "memory")]{
/// use email_clients::clients::EmailClient;
/// use email_clients::configuration::EmailConfiguration::Memory;
/// use email_clients::clients::memory::{MemoryClient, MemoryConfig};
///let config = MemoryConfig::default();
///
///let memory_email_client = EmailClient::Memory(MemoryClient::new(config));
/// # }
///```
///
/// To integrate mailersend client:
///
///```rust
/// # #[cfg(feature = "mailersend")]{
/// use email_clients::clients::EmailClient;
/// use email_clients::clients::mailersend::{MailerSendClient, MailerSendConfig};
/// use email_clients::clients::memory::MemoryClient;
///
/// let config = MailerSendConfig::default().api_token("API_TOKEN");
/// let mailersend_client = EmailClient::MailerSend(MailerSendClient::new(config));
/// # }
#[derive(Clone, Debug)]
pub enum EmailClient {
#[cfg(feature = "smtp")]
Expand Down Expand Up @@ -157,6 +164,7 @@ impl EmailClient {
/// Basic usage:
///
/// ```rust
/// # #[cfg(feature = "smtp")]{
/// # use email_clients::clients::EmailClient;
/// # use email_clients::clients::smtp::{SmtpClient, SmtpConfig};
/// use email_clients::email::EmailObject;
Expand All @@ -173,6 +181,7 @@ impl EmailClient {
/// unwrapped_client.send_emails(EmailObject::default()).await?;
/// # Ok(())
/// # }
/// # }
/// # fn main() {}
/// ```
pub fn unwrap(self) -> Box<dyn EmailTrait + Send> {
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
//!
//!```rust
//! use std::sync::mpsc;
//! # #[cfg(any(feature = "mailersend", feature = "terminal", feature = "smtp", feature = "memory", feature = "document-features"))]
//! # #[cfg(any(feature = "mailersend", feature = "terminal", feature = "smtp", feature = "memory", feature = "document-features", feature = "default"))]
//! use email_clients::clients::{EmailClient, get_email_client};
//! # #[cfg(feature = "mailersend")]
//! use email_clients::clients::mailersend::MailerSendConfig;
Expand Down

0 comments on commit 5ed4cae

Please sign in to comment.