feat: use discord_id from discord sso for role grant (#6326)

* feat: properly use labrinth's linked discord accts sso for discord bot

* Update email for fixture user in SQL insert

Signed-off-by: Calum H. <calum@modrinth.com>

* fix: rev changes

* fix: copy on email

* fix: lint

* fix: rev

* fix: lint

---------

Signed-off-by: Calum H. <calum@modrinth.com>
This commit is contained in:
Calum H.
2026-06-09 17:33:07 +00:00
committed by GitHub
parent bc5a761312
commit 543d25e2d6
20 changed files with 726 additions and 59 deletions
@@ -90,6 +90,8 @@ const NEWOWNER_NAME: &str = "new_owner.name";
const PAYOUTAVAILABLE_AMOUNT: &str = "payout.amount";
const PAYOUTAVAILABLE_PERIOD: &str = "payout.period";
const DISCORD_LINK_URL: &str = "discord.link_url";
#[derive(Clone)]
pub struct MailingIdentity {
from_name: String,
@@ -602,6 +604,15 @@ async fn collect_template_variables(
| NotificationBody::PasswordChanged
| NotificationBody::PasswordRemoved => Ok(EmailTemplate::Static(map)),
NotificationBody::DiscordRoleCreatorClub => {
map.insert(
DISCORD_LINK_URL,
format!("{}/discord/link", ENV.SITE_URL.trim_end_matches('/')),
);
Ok(EmailTemplate::Static(map))
}
NotificationBody::EmailChanged {
new_email,
to_email: _,