{"action":"closed","issue":{"url":"https://api.github.com/repos/sendgrid/sendgrid-java/issues/535","repository_url":"https://api.github.com/repos/sendgrid/sendgrid-java","labels_url":"https://api.github.com/repos/sendgrid/sendgrid-java/issues/535/labels{/name}","comments_url":"https://api.github.com/repos/sendgrid/sendgrid-java/issues/535/comments","events_url":"https://api.github.com/repos/sendgrid/sendgrid-java/issues/535/events","html_url":"https://github.com/sendgrid/sendgrid-java/issues/535","id":375877805,"node_id":"MDU6SXNzdWUzNzU4Nzc4MDU=","number":535,"title":"Email is sent twice sometimes when the dynamic data object is huge","user":{"login":"SailleshPawar","id":16855395,"node_id":"MDQ6VXNlcjE2ODU1Mzk1","avatar_url":"https://avatars2.githubusercontent.com/u/16855395?v=4","gravatar_id":"","url":"https://api.github.com/users/SailleshPawar","html_url":"https://github.com/SailleshPawar","followers_url":"https://api.github.com/users/SailleshPawar/followers","following_url":"https://api.github.com/users/SailleshPawar/following{/other_user}","gists_url":"https://api.github.com/users/SailleshPawar/gists{/gist_id}","starred_url":"https://api.github.com/users/SailleshPawar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SailleshPawar/subscriptions","organizations_url":"https://api.github.com/users/SailleshPawar/orgs","repos_url":"https://api.github.com/users/SailleshPawar/repos","events_url":"https://api.github.com/users/SailleshPawar/events{/privacy}","received_events_url":"https://api.github.com/users/SailleshPawar/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-31T09:47:39Z","updated_at":"2018-10-31T09:48:20Z","closed_at":"2018-10-31T09:48:20Z","author_association":"NONE","body":"#### Issue Summary\r\n\r\nI am using dynamic template to show the list of object in a table format in order to implement this i am using TemplateData to pass my object. Our users are receiving duplicate emails when there are more than 40000 objects in a dictionary collection.\r\n\r\n\r\n#### Steps to Reproduce\r\n\r\n1. Create a dynamic  transactional template on send grid with \r\n        like this\r\n           <table>             \r\n          {{#each alerts.AlertDetails}}            \r\n              <tr>\r\n                <td width=\"60%\" style=\"padding:0px; font-size:14px;padding-top:10px\">\r\n                  <b>{{FullLocationNameWithCode}}</b>\r\n                </td>\r\n                \r\n              </tr>\r\n                <tr>\r\n                <td width=\"60%\" style=\"padding:0px; font-size:14px\">\r\n                 {{ToolImpactedHeading}}\r\n                </td>\r\n               \r\n              </tr>\r\n              <tr>\r\n                <td width=\"60%\" style=\"padding:0px; font-size:14px\">\r\n                 <b>{{ToolTypeHeading}}</b>\r\n                </td>\r\n                <td style=\"padding:0px; font-size:14px\">\r\n                 {{ToolTypeName}}\r\n                </td>\r\n              </tr>        \r\n              <tr>\r\n                <td width=\"60%\" style=\"padding:0px; font-size:14px\">\r\n                 <b>{{SerialNumberHeading}}</b>\r\n                </td>\r\n                <td style=\"padding:0px; font-size:14px\">\r\n               {{SerialNumber}}\r\n                </td>\r\n            \r\n              </tr> \r\n              <tr>\r\n                <td width=\"60%\" style=\"padding:0px; font-size:14px\">\r\n                 <b>{{ComponentHeading}}</b>\r\n                </td>\r\n                <td style=\"padding:0px; font-size:14px\">\r\n               {{ComponentName}}\r\n                </td>\r\n            \r\n              </tr> \r\n              {{/each}}\r\n              \r\n            </table>\r\n\r\n\r\n2. Code\r\n\r\n public async Task<bool> SendEmail(Template mail)\r\n        {\r\n            try\r\n            {\r\n                var client = new SendGridClient(ApiKey);\r\n                var msg = new SendGridMessage();\r\n                DisableTracking(msg);\r\n                msg.From = (new EmailAddress(mail.From, mail.FromName));\r\n                msg.Subject = mail.Subject;\r\n                msg.SetTemplateId(mail.TemplateId);\r\n                Dictionary<string, SubscribedEmailVinTemplate> alertDetails = new Dictionary<string, SubscribedEmailVinTemplate>();\r\n                alertDetails.Add(\"alerts\", mail);\r\n                Personalization personalization = new Personalization();\r\n                personalization.TemplateData = alertDetails;\r\n                personalization.Tos = new List<EmailAddress>() { new EmailAddress(mail.To, mail.FirstName) };\r\n                msg.Personalizations.Add(personalization);\r\n                var response = await client.SendEmailAsync(msg);\r\n                return response.StatusCode == System.Net.HttpStatusCode.Unauthorized ? false : true;\r\n            }\r\n            catch (Exception ex)\r\n            {\r\n                throw ex;\r\n            }\r\n        }\r\n\r\n\r\n3. Further steps, etc.\r\n\r\nThis happens sometimes and only for users which has huge objects.\r\n\r\n#### Technical details:\r\n\r\n* sendgrid-c# 9.10.0.0   : master (latest commit: [commit number])\r\n* Java Version: X.X"}}
{"actor":{"display_login":"SailleshPawar"}}