diff --git a/Site/Pages/v5/Comms/SendMassMessage.aspx b/Site/Pages/v5/Comms/SendMassMessage.aspx index 5b2a1fcd..e0e6ee40 100644 --- a/Site/Pages/v5/Comms/SendMassMessage.aspx +++ b/Site/Pages/v5/Comms/SendMassMessage.aspx @@ -35,13 +35,31 @@ function onClickTest() { + if (<%=this.RunningOnSandbox%> && testMessageSandboxAddress == '') + { + // Prompt for an address to send to + // This should preferably be in a mod on just Sandbox and not in code everywhere + + alertify.prompt("You're currently using the Sandbox. Where would you like a test message sent?", + function (evt, value) + { + testMessageSandboxAddress = value; // may need sanitation + onClickTest(); // rerun with value set + }, + function() { + alertify.log('Canceled.'); + }); + + return false; // do not process at this time, wait for async response + } + var jsonData = { recipientTypeId: selectedRecipientClass, geographyId: selectedGeographyId, mode: "Mail", subject: "Test Subject", body: "SHAKAZAM *IT WORKS*\r\n\r\nMaybe?", - dummyMail: "rick@falkvinge.net", + dummyMail: testMessageSandboxAddress, live: false }; @@ -76,6 +94,8 @@ } + var testMessageSandboxAddress = ''; + diff --git a/Site/Pages/v5/Comms/SendMassMessage.aspx.cs b/Site/Pages/v5/Comms/SendMassMessage.aspx.cs index 0b9fb8d2..229218df 100644 --- a/Site/Pages/v5/Comms/SendMassMessage.aspx.cs +++ b/Site/Pages/v5/Comms/SendMassMessage.aspx.cs @@ -8,6 +8,7 @@ using Resources; using Swarmops.Logic.Communications; using Swarmops.Logic.Security; using Swarmops.Logic.Structure; +using Swarmops.Logic.Support; using Swarmops.Logic.Swarm; namespace Swarmops.Frontend.Pages.Comms @@ -118,6 +119,11 @@ namespace Swarmops.Frontend.Pages.Comms public string DisplayMessage; }; + public string RunningOnSandbox + { + get { return PilotInstallationIds.IsPilot(PilotInstallationIds.DevelopmentSandbox) ? "true" : "false"; } + } + // ReSharper disable once InconsistentNaming public string Localized_SendMessageResult {