Skip to content

Commit

Permalink
chore(notifications): remove Email from UserNotificationChannel
Browse files Browse the repository at this point in the history
  • Loading branch information
thevaibhav-dixit committed Feb 15, 2024
1 parent 9cc3fd1 commit dcb88a8
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 7 deletions.
1 change: 0 additions & 1 deletion core/notifications/proto/notifications.proto
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ service NotificationsService {

enum NotificationChannel {
PUSH = 0;
EMAIL = 1;
}

enum NotificationCategory {
Expand Down
5 changes: 1 addition & 4 deletions core/notifications/src/email_executor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ mod config;
pub mod error;
mod smtp;

use crate::{notification_event::*, primitives::*, user_notification_settings::*};
use crate::{notification_event::*, user_notification_settings::*};

pub use config::*;
use error::*;
Expand Down Expand Up @@ -30,9 +30,6 @@ impl EmailExecutor {

pub async fn notify<T: NotificationEvent>(&self, event: &T) -> Result<(), EmailExecutorError> {
let settings = self.settings.find_for_user_id(event.user_id()).await?;
if !settings.should_send_notification(UserNotificationChannel::Email, event.category()) {
return Ok(());
}
let msg = event.to_localized_msg(settings.locale().unwrap_or_default());

self.smtp.send_email(msg).await?;
Expand Down
1 change: 0 additions & 1 deletion core/notifications/src/grpc/server/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ impl From<proto::NotificationChannel> for UserNotificationChannel {
fn from(channel: proto::NotificationChannel) -> Self {
match channel {
proto::NotificationChannel::Push => UserNotificationChannel::Push,
proto::NotificationChannel::Email => UserNotificationChannel::Email,
}
}
}
Expand Down
1 change: 0 additions & 1 deletion core/notifications/src/primitives.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ impl std::fmt::Display for PushDeviceToken {
#[graphql(name = "UserNotificationChannel")]
pub enum UserNotificationChannel {
Push,
Email,
}

#[derive(async_graphql::Enum, Debug, Hash, Copy, Clone, Eq, PartialEq, Deserialize, Serialize)]
Expand Down

0 comments on commit dcb88a8

Please sign in to comment.