aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2019-06-04 12:35:54 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2019-06-04 12:35:54 +0300
commit2c613cb0b0f1b73236bed1578b570c1ca6f6deaf (patch)
tree46ae99310301f6c11638594ce118d1f9784f880f /Software/Visual_Studio
parent922546a39a76280382a82607ed1f54e565f1d71e (diff)
downloadTango-2c613cb0b0f1b73236bed1578b570c1ca6f6deaf.tar.gz
Tango-2c613cb0b0f1b73236bed1578b570c1ca6f6deaf.zip
Implemented card printing screens and email.
Implemented Chrome Custom Tabs with WebView fallback for app URL's. Several bug fixes and improvements.
Diffstat (limited to 'Software/Visual_Studio')
-rw-r--r--Software/Visual_Studio/TCC/Tango.TCC.BL/Web/PrintCardRequest.cs4
-rw-r--r--Software/Visual_Studio/TCC/Tango.TCC.Service/Controllers/ColorDetectionController.cs10
2 files changed, 6 insertions, 8 deletions
diff --git a/Software/Visual_Studio/TCC/Tango.TCC.BL/Web/PrintCardRequest.cs b/Software/Visual_Studio/TCC/Tango.TCC.BL/Web/PrintCardRequest.cs
index b496a9041..23a1c396a 100644
--- a/Software/Visual_Studio/TCC/Tango.TCC.BL/Web/PrintCardRequest.cs
+++ b/Software/Visual_Studio/TCC/Tango.TCC.BL/Web/PrintCardRequest.cs
@@ -9,9 +9,7 @@ namespace Tango.TCC.BL.Web
{
public class PrintCardRequest : WebRequestMessage
{
- public String From { get; set; }
-
- public String To { get; set; }
+ public String Address { get; set; }
public String Message { get; set; }
}
diff --git a/Software/Visual_Studio/TCC/Tango.TCC.Service/Controllers/ColorDetectionController.cs b/Software/Visual_Studio/TCC/Tango.TCC.Service/Controllers/ColorDetectionController.cs
index 9921b50a8..011b7f3be 100644
--- a/Software/Visual_Studio/TCC/Tango.TCC.Service/Controllers/ColorDetectionController.cs
+++ b/Software/Visual_Studio/TCC/Tango.TCC.Service/Controllers/ColorDetectionController.cs
@@ -317,7 +317,7 @@ namespace Tango.TCC.Service.Controllers
if (device != null)
{
- device.Email = request.To;
+ device.Email = request.Address;
db.SaveChanges();
}
}
@@ -327,11 +327,10 @@ namespace Tango.TCC.Service.Controllers
var client = new SendGridClient(TCCServiceConfig.SEND_GRID_API_KEY);
SendGridMessage msg = new SendGridMessage();
- msg.SetFrom("Twine Solutions LTD");
- msg.AddTo(request.To);
+ msg.SetFrom("info@twine-s.com", "Twine Solutions LTD");
+ msg.AddTo(request.Address);
msg.Subject = "Print a twine TTCâ„¢ card";
msg.SetTemplateId("d-43b1aa3fe9c140349e3fb0ba2d1afff1");
-
var dynamicTemplateData = new
{
Message = request.Message,
@@ -339,12 +338,13 @@ namespace Tango.TCC.Service.Controllers
msg.SetTemplateData(dynamicTemplateData);
- byte[] data = File.ReadAllBytes(HostingEnvironment.MapPath("~/AppData/card.pdf"));
+ byte[] data = File.ReadAllBytes(HostingEnvironment.MapPath("~/App_Data/card.pdf"));
var base64 = Convert.ToBase64String(data);
msg.AddAttachment("Twine TCC card.pdf", base64, "application/pdf");
var result = client.SendEmailAsync(msg).GetAwaiter().GetResult();
+ //var a = result.DeserializeResponseBodyAsync(result.Body); //TODO find the actual error message like this!
if (result.StatusCode != HttpStatusCode.Accepted)
{