Skip to content

Commit

Permalink
chore(notifications): remove dependency on openssl
Browse files Browse the repository at this point in the history
  • Loading branch information
thevaibhav-dixit committed Feb 15, 2024
1 parent f821476 commit 2a80600
Show file tree
Hide file tree
Showing 9 changed files with 164 additions and 383 deletions.
128 changes: 39 additions & 89 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ prost = "0.12"
rust-i18n = "3"
google-fcm1 = "5.0.3"
sqlxmq = { version = "0.5", default-features = false, features = ["runtime-tokio-rustls"] }
lettre = { version = "0.11.4", features = ["tokio1", "tokio1-native-tls"] }
lettre = { version = "0.11.4", default-features = false, features = ["builder", "tokio1", "tokio1-rustls-tls", "smtp-transport"] }

7 changes: 4 additions & 3 deletions core/notifications/src/email_executor/lettre/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ mod config;
pub mod error;

use lettre::{
message::Mailbox, transport::smtp::authentication::Credentials, AsyncSmtpTransport,
AsyncTransport, Tokio1Executor,
message::{Mailbox, Message},
transport::smtp::authentication::Credentials,
AsyncSmtpTransport, AsyncTransport, Tokio1Executor,
};

pub use config::*;
Expand All @@ -25,7 +26,7 @@ impl LettreClient {
}

pub async fn send_email(&self, title: String, body: String) -> Result<(), LettreError> {
let email = lettre::Message::builder()
let email = Message::builder()
.from(Mailbox::new(None, "some-email".parse()?))
.to(Mailbox::new(None, "some-email".parse()?))
.subject(title)
Expand Down
3 changes: 0 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@
clang
lld
rust-toolchain
openssl
openssl.dev
];

nativeBuildInputs = with pkgs;
Expand Down Expand Up @@ -77,7 +75,6 @@
grpcurl
buf
transifex-cli
pkg-config
]
++ buck2NativeBuildInputs
++ lib.optionals pkgs.stdenv.isLinux [
Expand Down
Loading

0 comments on commit 2a80600

Please sign in to comment.