Skip to content
Merged
Show file tree
Hide file tree
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
7 changes: 7 additions & 0 deletions DNN Platform/Library/Services/Mail/Mail.cs
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,13 @@ public static string SendMail(int portalId, int userId, MessageType msgType, Por
subject = "EMAIL_PASSWORD_REMINDER_USER_ISNOT_APPROVED_SUBJECT";
body = "EMAIL_PASSWORD_REMINDER_USER_ISNOT_APPROVED_BODY";
break;
case MessageType.PasswordReminderUserIsNotApprovedAdmin:
subject = "EMAIL_PASSWORD_REMINDER_USER_ISNOT_APPROVED_ADMINISTRATOR_SUBJECT";
body = "EMAIL_PASSWORD_REMINDER_USER_ISNOT_APPROVED_ADMINISTRATOR_BODY";
toUser = settings.AdministratorId;
admin = UserController.GetUserById(settings.PortalId, settings.AdministratorId);
locale = admin.Profile.PreferredLocale;
break;
case MessageType.UserAuthorized:
subject = "EMAIL_USER_AUTHORIZED_SUBJECT";
body = "EMAIL_USER_AUTHORIZED_BODY";
Expand Down
1 change: 1 addition & 0 deletions DNN Platform/Library/Services/Mail/MessageType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ public enum MessageType
PasswordReminderUserIsNotApproved = 9,
UserAuthorized = 10,
UserUnAuthorized = 11,
PasswordReminderUserIsNotApprovedAdmin = 12,
}
}
17 changes: 14 additions & 3 deletions DNN Platform/Website/App_GlobalResources/GlobalResources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1361,9 +1361,8 @@ Sincerely,
<data name="EMAIL_PASSWORD_REMINDER_USER_ISNOT_APPROVED_BODY.Text" xml:space="preserve">
<value>Dear [User:DisplayName],

You have requested a Password Reset Token from [Portal:PortalName], but Your account is pending approval.

Password can be reset after account is approved.
You have requested a Password Reset Token from [Portal:PortalName], but your account is pending approval.
The administrator for [Portal:PortalName] has been notified for review and will issue another password reset email if your account is approved.

Sincerely,
[Portal:PortalName]
Expand All @@ -1374,6 +1373,18 @@ Sincerely,
<data name="EMAIL_PASSWORD_REMINDER_USER_ISNOT_APPROVED_SUBJECT.Text" xml:space="preserve">
<value>[Portal:PortalName] Password Reminder</value>
</data>
<data name="EMAIL_PASSWORD_REMINDER_USER_ISNOT_APPROVED_ADMINISTRATOR_BODY.Text" xml:space="preserve">
<value>
The following user has requested a Password Reset Token from [Portal:PortalName], but the user account is pending approval.
User Name: [User:UserName]
Display Name: [User:DisplayName]

After reviewing this user, if the account is authorized, resend the user a password reset email.
</value>
</data>
<data name="EMAIL_PASSWORD_REMINDER_USER_ISNOT_APPROVED_ADMINISTRATOR_SUBJECT.Text" xml:space="preserve">
<value>[Portal:PortalName] Password Reminder requested for unapproved User [User:Username]</value>
</data>
<data name="503.Error" xml:space="preserve">
<value>{0} - 503 Service Unavailable</value>
</data>
Expand Down
1 change: 1 addition & 0 deletions DNN Platform/Website/admin/Security/SendPassword.ascx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ protected void OnSendPasswordClick(object sender, EventArgs e)
if (this.user.Membership.Approved == false)
{
Mail.SendMail(this.user, MessageType.PasswordReminderUserIsNotApproved, this.PortalSettings);
Mail.SendMail(this.user, MessageType.PasswordReminderUserIsNotApprovedAdmin, this.PortalSettings);
canSend = false;
}

Expand Down