Skip to content

Commit 9c0f4d6

Browse files
committed
subscribe nda on accept invite
1 parent ac92ebe commit 9c0f4d6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/db/operations/invitations.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use crate::db::logs::log_comment_body;
55
use crate::db::operations::models::*;
66
use crate::db::Pool;
77
use crate::mail::manager::send_email;
8+
use crate::mail::manager::subscribe_nda;
89
use crate::mail::templates::Template;
910
use crate::rules::engine::*;
1011
use crate::rules::RuleContext;
@@ -196,6 +197,9 @@ pub async fn accept_invitation(
196197
))?;
197198
let connection = pool.get()?;
198199
let user_profile = internal::user::user_profile_by_uuid(&connection, &user.user_uuid)?;
200+
if group_name == "nda" {
201+
subscribe_nda(&user_profile.email)
202+
}
199203
accept(&connection, group_name, user)?;
200204
drop(connection);
201205
add_group_to_profile(cis_client, group_name.to_owned(), user_profile.profile).await

0 commit comments

Comments
 (0)