Added test mail on changing SMTP settings

This commit is contained in:
Rick Falkvinge
2015-01-25 10:17:17 +01:00
parent b916d59092
commit 1be972bd40
5 changed files with 33 additions and 0 deletions
@@ -530,6 +530,24 @@ namespace Swarmops.Logic.App_GlobalResources {
}
}
/// <summary>
/// Looks up a localized string similar to This is a test mail sent by Swarmops [SwarmopsVersion] running on [HostName]. You just changed the mail server settings. To verify that the new settings are correct, Swarmops dispatches this test message to be sent from the back end..
/// </summary>
internal static string System_MailServerTest_Body {
get {
return ResourceManager.GetString("System_MailServerTest_Body", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Swarmops Mail Server Test.
/// </summary>
internal static string System_MailServerTest_Subject {
get {
return ResourceManager.GetString("System_MailServerTest_Subject", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Swarmops Backend version [SwarmopsVersion] on host [HostName] has successfully started and connected to database and notification frameworks..
/// </summary>
@@ -313,6 +313,12 @@ This is for information only. You do not need to take action.</value>
<data name="System_Exception_Subject" xml:space="preserve">
<value>Swarmops EXCEPTION!</value>
</data>
<data name="System_MailServerTest_Body" xml:space="preserve">
<value>This is a test mail sent by Swarmops [SwarmopsVersion] running on [HostName]. You just changed the mail server settings. To verify that the new settings are correct, Swarmops dispatches this test message to be sent from the back end.</value>
</data>
<data name="System_MailServerTest_Subject" xml:space="preserve">
<value>Swarmops Mail Server Test</value>
</data>
<data name="System_Startup_Body" xml:space="preserve">
<value>Swarmops Backend version [SwarmopsVersion] on host [HostName] has successfully started and connected to database and notification frameworks.</value>
</data>
@@ -100,6 +100,7 @@ namespace Swarmops.Logic.Communications.Transmission
System_Startup,
System_Exception,
System_DatabaseSchemaUpgraded,
System_MailServerTest,
CashAdvance_Requested,
CashAdvance_Attested,
CashAdvance_Deattested,
@@ -206,4 +206,7 @@
<data name="SystemSettings_SmtpServer" xml:space="preserve">
<value>SMTP Server (user:pass@host:port)</value>
</data>
<data name="SystemSettings_TestMailSent" xml:space="preserve">
<value>Swarmops has sent you a test mail to verify your new SMTP server settings.</value>
</data>
</root>
+5
View File
@@ -11,6 +11,8 @@ using System.Globalization;
using System.Web.Services;
using System.Text.RegularExpressions;
using Swarmops.Frontend.Controls.v5.Base;
using Swarmops.Logic.Communications;
using Swarmops.Logic.Structure;
namespace Swarmops.Frontend.Pages.v5.Admin
{
@@ -98,8 +100,11 @@ namespace Swarmops.Frontend.Pages.v5.Admin
SystemSettings.SmtpHost = host;
SystemSettings.SmtpPort = port;
OutboundComm.CreateNotification(Organization.Sandbox, Logic.Communications.Transmission.NotificationResource.System_MailServerTest);
result.ResultCode = AjaxTextBox.CodeChanged;
result.NewData = FormatSmtpAccessString (user, pass, host, port);
result.DisplayMessage = Resources.Pages.Admin.SystemSettings_TestMailSent;
}
else
{