Percent-encode org_name in links

If org_name contains spaces, the generated link will not work in some email clients unless it is percent-encoded
This commit is contained in:
Andrés Maldonado
2023-01-03 11:19:09 +01:00
parent 10dadfca06
commit 2897c24e83
3 changed files with 3 additions and 2 deletions

View File

@@ -245,6 +245,7 @@ pub async fn send_invite(
"org_id": org_id.as_deref().unwrap_or("_"),
"org_user_id": org_user_id.as_deref().unwrap_or("_"),
"email": percent_encode(address.as_bytes(), NON_ALPHANUMERIC).to_string(),
"org_name_encoded": percent_encode(org_name.as_bytes(), NON_ALPHANUMERIC).to_string(),
"org_name": org_name,
"token": invite_token,
}),