From 0586901571ac99cb62572bc48aef14962590d5cd Mon Sep 17 00:00:00 2001 From: Ed Halley <1223980+hariedo@users.noreply.github.com> Date: Sat, 28 Jun 2025 12:59:57 -0500 Subject: [PATCH 1/4] Better publisher validation email PublisherService.cs Potential alternative to Issue 58 https://github.com/Unity-Developer-Community/UDC-Bot/issues/58 --- DiscordBot/Services/PublisherService.cs | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/DiscordBot/Services/PublisherService.cs b/DiscordBot/Services/PublisherService.cs index 20599af9..dff1712f 100644 --- a/DiscordBot/Services/PublisherService.cs +++ b/DiscordBot/Services/PublisherService.cs @@ -60,15 +60,25 @@ public async Task SendVerificationCode(string name, string email, uint packageId var code = Convert.ToBase64String(random); + var body = string.Join('\n', new string[] { + $"Somebody named @{name} on the Unity Developer Community Discord server " + + "has requested the Publisher role on that server.", + "", + $"Here's your validation code: {code}", + "", + "If this is you, enter the command '!verify {packageID} {code}' to complete the process.", + "", + "If this is NOT you, feel free to join the UDC Discord server " + + "to report @{name} to the @Administrators (and join our community if you like).", + "https://discord.gg/bu3bbby", + }; + _verificationCodes[packageId] = code; var message = new MimeMessage(); message.From.Add(new MailboxAddress("Unity Developer Community", _settings.Email)); message.To.Add(new MailboxAddress(name, email)); message.Subject = "Unity Developer Community Package Validation"; - message.Body = new TextPart("plain") - { - Text = @"Here's your validation code : " + code - }; + message.Body = new TextPart("plain") { Text = body }; using (var client = new SmtpClient()) { @@ -102,4 +112,4 @@ public async Task ValidatePublisherWithCode(IUser user, uint packageId, return "Your publisher account has been verified and you now have the `Asset-Publisher` role!"; } -} \ No newline at end of file +} From 2e76772c6599894355d459bd59f6873b966d4264 Mon Sep 17 00:00:00 2001 From: Ed Halley <1223980+hariedo@users.noreply.github.com> Date: Sat, 28 Jun 2025 13:06:27 -0500 Subject: [PATCH 2/4] Update PublisherService.cs --- DiscordBot/Services/PublisherService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DiscordBot/Services/PublisherService.cs b/DiscordBot/Services/PublisherService.cs index dff1712f..7cf10483 100644 --- a/DiscordBot/Services/PublisherService.cs +++ b/DiscordBot/Services/PublisherService.cs @@ -70,8 +70,8 @@ public async Task SendVerificationCode(string name, string email, uint packageId "", "If this is NOT you, feel free to join the UDC Discord server " + "to report @{name} to the @Administrators (and join our community if you like).", - "https://discord.gg/bu3bbby", - }; + "https://discord.gg/bu3bbby" + }); _verificationCodes[packageId] = code; var message = new MimeMessage(); From 038585a264e2702b237f724deb67257ab21719b7 Mon Sep 17 00:00:00 2001 From: Ed Halley <1223980+hariedo@users.noreply.github.com> Date: Sat, 28 Jun 2025 13:17:31 -0500 Subject: [PATCH 3/4] Update PublisherService.cs --- DiscordBot/Services/PublisherService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DiscordBot/Services/PublisherService.cs b/DiscordBot/Services/PublisherService.cs index 7cf10483..1904324f 100644 --- a/DiscordBot/Services/PublisherService.cs +++ b/DiscordBot/Services/PublisherService.cs @@ -66,10 +66,10 @@ public async Task SendVerificationCode(string name, string email, uint packageId "", $"Here's your validation code: {code}", "", - "If this is you, enter the command '!verify {packageID} {code}' to complete the process.", + $"If this is you, enter the command '!verify {packageID} {code}' to complete the process.", "", "If this is NOT you, feel free to join the UDC Discord server " + - "to report @{name} to the @Administrators (and join our community if you like).", + $"to report @{name} to the @Administrators (and join our community if you like).", "https://discord.gg/bu3bbby" }); From 5821e972e5000194875f4ed900b3e2fa3d5a29dd Mon Sep 17 00:00:00 2001 From: Ed Halley <1223980+hariedo@users.noreply.github.com> Date: Sat, 28 Jun 2025 13:18:41 -0500 Subject: [PATCH 4/4] Update PublisherService.cs --- DiscordBot/Services/PublisherService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DiscordBot/Services/PublisherService.cs b/DiscordBot/Services/PublisherService.cs index 1904324f..3d147e51 100644 --- a/DiscordBot/Services/PublisherService.cs +++ b/DiscordBot/Services/PublisherService.cs @@ -66,7 +66,7 @@ public async Task SendVerificationCode(string name, string email, uint packageId "", $"Here's your validation code: {code}", "", - $"If this is you, enter the command '!verify {packageID} {code}' to complete the process.", + $"If this is you, enter the command '!verify {packageId} {code}' to complete the process.", "", "If this is NOT you, feel free to join the UDC Discord server " + $"to report @{name} to the @Administrators (and join our community if you like).",