diff --git a/src/Ombi/Controllers/IdentityController.cs b/src/Ombi/Controllers/IdentityController.cs
index 8e28a18c4..7c5730e0c 100644
--- a/src/Ombi/Controllers/IdentityController.cs
+++ b/src/Ombi/Controllers/IdentityController.cs
@@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Threading.Tasks;
-
+using System.Web;
using AutoMapper;
using Hangfire;
using Microsoft.AspNetCore.Authorization;
@@ -621,25 +621,54 @@ namespace Ombi.Controllers
return defaultMessage;
}
- // We have the user
- var token = await UserManager.GeneratePasswordResetTokenAsync(user);
- // We now need to email the user with this token
- var emailSettings = await EmailSettings.GetSettingsAsync();
+
var customizationSettings = await CustomizationSettings.GetSettingsAsync();
var appName = (string.IsNullOrEmpty(customizationSettings.ApplicationName)
? "Ombi"
: customizationSettings.ApplicationName);
+ var emailSettings = await EmailSettings.GetSettingsAsync();
+
customizationSettings.AddToUrl("/token?token=");
var url = customizationSettings.ApplicationUrl;
- await EmailProvider.SendAdHoc(new NotificationMessage
+ if (user.UserType == UserType.PlexUser)
{
- To = user.Email,
- Subject = $"{appName} Password Reset",
- Message = $"You recently made a request to reset your {appName} account. Please click the link below to complete the process.
" +
- $" Reset "
- }, emailSettings);
+ await EmailProvider.SendAdHoc(new NotificationMessage
+ {
+ To = user.Email,
+ Subject = $"{appName} Password Reset",
+ Message =
+ $"You recently made a request to reset your {appName} account. Please click the link below to complete the process.
" +
+ $" Reset "
+ }, emailSettings);
+ }
+ else if (user.UserType == UserType.EmbyUser && user.IsEmbyConnect)
+ {
+ await EmailProvider.SendAdHoc(new NotificationMessage
+ {
+ To = user.Email,
+ Subject = $"{appName} Password Reset",
+ Message =
+ $"You recently made a request to reset your {appName} account.
" +
+ $"To reset your password you need to go to Emby.Media and then click on your Username > Edit Profile > Email and Password"
+ }, emailSettings);
+ }
+ else
+ {
+ // We have the user
+ var token = await UserManager.GeneratePasswordResetTokenAsync(user);
+ var encodedToken = WebUtility.UrlEncode(token);
+
+ await EmailProvider.SendAdHoc(new NotificationMessage
+ {
+ To = user.Email,
+ Subject = $"{appName} Password Reset",
+ Message =
+ $"You recently made a request to reset your {appName} account. Please click the link below to complete the process.
" +
+ $" Reset "
+ }, emailSettings);
+ }
return defaultMessage;
}