feat: make email sending async
This commit is contained in:
parent
8f2182900c
commit
781448442c
|
|
@ -228,19 +228,26 @@ pub async fn invite_workspace_members(
|
||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
mailer
|
// send email can be slow, so send email in background
|
||||||
.send_workspace_invite(
|
let cloned_mailer = mailer.clone();
|
||||||
invitation.email,
|
tokio::spawn(async move {
|
||||||
WorkspaceInviteMailerParam {
|
if let Err(err) = cloned_mailer
|
||||||
user_icon_url,
|
.send_workspace_invite(
|
||||||
username: inviter_name,
|
invitation.email,
|
||||||
workspace_name,
|
WorkspaceInviteMailerParam {
|
||||||
workspace_icon_url,
|
user_icon_url,
|
||||||
workspace_member_count,
|
username: inviter_name,
|
||||||
accept_url,
|
workspace_name,
|
||||||
},
|
workspace_icon_url,
|
||||||
)
|
workspace_member_count,
|
||||||
.await?;
|
accept_url,
|
||||||
|
},
|
||||||
|
)
|
||||||
|
.await
|
||||||
|
{
|
||||||
|
tracing::error!("Failed to send workspace invite email: {:?}", err);
|
||||||
|
};
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
txn
|
txn
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue