More on Mass Message, short of recipient resolution
This commit is contained in:
@@ -1195,5 +1195,19 @@ namespace Swarmops.Logic.Swarm
|
||||
|
||||
public const int OpenLedgersIdentity = -1;
|
||||
|
||||
|
||||
public Participation ParticipationOf(Organization organization)
|
||||
{
|
||||
Participations participations = GetMemberships();
|
||||
foreach (Participation participation in participations)
|
||||
{
|
||||
if (participation.OrganizationId == organization.Identity)
|
||||
{
|
||||
return participation;
|
||||
}
|
||||
}
|
||||
|
||||
throw new InvalidOperationException("No valid participation for requested organization");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -108,9 +108,31 @@ namespace Swarmops.Frontend.Pages.Comms
|
||||
public static AjaxCallResult ExecuteSend(int recipientTypeId, int geographyId, string mode, string subject,
|
||||
string body, string dummyMail, bool live)
|
||||
{
|
||||
OutboundComm.CreateSandboxMail(subject, body, dummyMail);
|
||||
AuthenticationData authData = GetAuthenticationDataAndCulture();
|
||||
|
||||
return new AjaxCallResult {Success = false};
|
||||
if (PilotInstallationIds.IsPilot(PilotInstallationIds.DevelopmentSandbox))
|
||||
{
|
||||
if (authData.CurrentUser.Identity == 1)
|
||||
{
|
||||
OutboundComm.CreateSandboxMail(subject, body, dummyMail);
|
||||
return new AjaxCallResult {Success = true};
|
||||
}
|
||||
|
||||
return new AjaxCallResult {Success = false}; // wtf, this shouldn't happen
|
||||
}
|
||||
else if (!live)
|
||||
{
|
||||
// Test mail
|
||||
|
||||
OutboundComm.CreateParticipantMail(subject, body,
|
||||
authData.CurrentUser.ParticipationOf(authData.CurrentOrganization), authData.CurrentUser);
|
||||
|
||||
return new AjaxCallResult {Success = true};
|
||||
}
|
||||
else // Send live
|
||||
{
|
||||
throw new NotImplementedException(); // TODO: Write resolver
|
||||
}
|
||||
}
|
||||
|
||||
public struct ConfirmPayoutResult
|
||||
|
||||
Reference in New Issue
Block a user