Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions DiscordBot/Services/PublisherService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
{
Expand Down Expand Up @@ -102,4 +112,4 @@ public async Task<string> ValidatePublisherWithCode(IUser user, uint packageId,

return "Your publisher account has been verified and you now have the `Asset-Publisher` role!";
}
}
}
Loading