aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Web
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2024-12-05 02:57:33 +0200
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2024-12-05 02:57:33 +0200
commit6145633410ecac8d9847dfb4272a5ee11325c65f (patch)
tree56cb73a999f6805e37fa97d7c9a314e9342ea23f /Software/Visual_Studio/Web
parent92de61904c6ae3f8455827944b4aa62c5582bbb5 (diff)
downloadTango-6145633410ecac8d9847dfb4272a5ee11325c65f.tar.gz
Tango-6145633410ecac8d9847dfb4272a5ee11325c65f.zip
Finished SMS.
Diffstat (limited to 'Software/Visual_Studio/Web')
-rw-r--r--Software/Visual_Studio/Web/Tango.MachineService/Controllers/PPCController.cs14
-rw-r--r--Software/Visual_Studio/Web/Tango.MachineService/MachineServiceConfig.cs4
-rw-r--r--Software/Visual_Studio/Web/Tango.MachineService/Web.config3
3 files changed, 18 insertions, 3 deletions
diff --git a/Software/Visual_Studio/Web/Tango.MachineService/Controllers/PPCController.cs b/Software/Visual_Studio/Web/Tango.MachineService/Controllers/PPCController.cs
index d8f514c42..57bdc2fbf 100644
--- a/Software/Visual_Studio/Web/Tango.MachineService/Controllers/PPCController.cs
+++ b/Software/Visual_Studio/Web/Tango.MachineService/Controllers/PPCController.cs
@@ -844,9 +844,19 @@ namespace Tango.MachineService.Controllers
if (MachineServiceConfig.TWILIO_ENABLE_SMS)
{
- foreach (var phone in request.PhoneNumbers)
+ if (MachineServiceConfig.TWILIO_ENABLE_ALPHA_SENDER)
{
- MessageResource.Create(from: MachineServiceConfig.TWILIO_FROM_NUMBER, to: new PhoneNumber(phone), body: request.Message);
+ foreach (var phone in request.PhoneNumbers)
+ {
+ MessageResource.Create(messagingServiceSid: MachineServiceConfig.TWILIO_MESSAGING_SERVICE_SID, to: new PhoneNumber(phone), body: request.Message);
+ }
+ }
+ else
+ {
+ foreach (var phone in request.PhoneNumbers)
+ {
+ MessageResource.Create(from: MachineServiceConfig.TWILIO_FROM_NUMBER, to: new PhoneNumber(phone), body: request.Message);
+ }
}
}
diff --git a/Software/Visual_Studio/Web/Tango.MachineService/MachineServiceConfig.cs b/Software/Visual_Studio/Web/Tango.MachineService/MachineServiceConfig.cs
index e8240fd46..15c0637d6 100644
--- a/Software/Visual_Studio/Web/Tango.MachineService/MachineServiceConfig.cs
+++ b/Software/Visual_Studio/Web/Tango.MachineService/MachineServiceConfig.cs
@@ -26,9 +26,11 @@ namespace Tango.MachineService
public static String SEND_GRID_API_KEY => ConfigurationManager.AppSettings[nameof(SEND_GRID_API_KEY)].ToString();
- public static bool TWILIO_ENABLE_SMS => bool.Parse(ConfigurationManager.AppSettings[nameof(TWILIO_ENABLE_SMS)].ToString());
public static String TWILIO_ACCOUNT_SID => ConfigurationManager.AppSettings[nameof(TWILIO_ACCOUNT_SID)].ToString();
public static String TWILIO_AUTH_TOKEN => ConfigurationManager.AppSettings[nameof(TWILIO_AUTH_TOKEN)].ToString();
+ public static String TWILIO_MESSAGING_SERVICE_SID => ConfigurationManager.AppSettings[nameof(TWILIO_MESSAGING_SERVICE_SID)].ToString();
public static String TWILIO_FROM_NUMBER => ConfigurationManager.AppSettings[nameof(TWILIO_FROM_NUMBER)].ToString();
+ public static bool TWILIO_ENABLE_SMS => bool.Parse(ConfigurationManager.AppSettings[nameof(TWILIO_ENABLE_SMS)].ToString());
+ public static bool TWILIO_ENABLE_ALPHA_SENDER => bool.Parse(ConfigurationManager.AppSettings[nameof(TWILIO_ENABLE_ALPHA_SENDER)].ToString());
}
} \ No newline at end of file
diff --git a/Software/Visual_Studio/Web/Tango.MachineService/Web.config b/Software/Visual_Studio/Web/Tango.MachineService/Web.config
index 8cc11ebb5..84b3d0a3a 100644
--- a/Software/Visual_Studio/Web/Tango.MachineService/Web.config
+++ b/Software/Visual_Studio/Web/Tango.MachineService/Web.config
@@ -41,8 +41,11 @@
<add key="TWILIO_ACCOUNT_SID" value="AC05c701c7c282134811f96a120119ac34" />
<add key="TWILIO_AUTH_TOKEN" value="e2c4cd2c0d431ed64f5c9832c1322096" />
+ <add key="TWILIO_MESSAGING_SERVICE_SID" value="MG5c99bbd333f950cd03ba85bdde6bb86d" />
<add key="TWILIO_FROM_NUMBER" value="+16466815605" />
<add key="TWILIO_ENABLE_SMS" value="true" />
+ <add key="TWILIO_ENABLE_ALPHA_SENDER" value="true" />
+
</appSettings>
<!--
For a description of web.config changes see http://go.microsoft.com/fwlink/?LinkId=235367.