{"action":"created","issue":{"url":"https://api.github.com/repos/sendgrid/sendgrid-csharp/issues/272","repository_url":"https://api.github.com/repos/sendgrid/sendgrid-csharp","labels_url":"https://api.github.com/repos/sendgrid/sendgrid-csharp/issues/272/labels{/name}","comments_url":"https://api.github.com/repos/sendgrid/sendgrid-csharp/issues/272/comments","events_url":"https://api.github.com/repos/sendgrid/sendgrid-csharp/issues/272/events","html_url":"https://github.com/sendgrid/sendgrid-csharp/issues/272","id":165460229,"number":272,"title":"How to send e-mail using template","user":{"login":"julianonunes","id":1476977,"avatar_url":"https://avatars.githubusercontent.com/u/1476977?v=3","gravatar_id":"","url":"https://api.github.com/users/julianonunes","html_url":"https://github.com/julianonunes","followers_url":"https://api.github.com/users/julianonunes/followers","following_url":"https://api.github.com/users/julianonunes/following{/other_user}","gists_url":"https://api.github.com/users/julianonunes/gists{/gist_id}","starred_url":"https://api.github.com/users/julianonunes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/julianonunes/subscriptions","organizations_url":"https://api.github.com/users/julianonunes/orgs","repos_url":"https://api.github.com/users/julianonunes/repos","events_url":"https://api.github.com/users/julianonunes/events{/privacy}","received_events_url":"https://api.github.com/users/julianonunes/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/sendgrid/sendgrid-csharp/labels/type:%20question","name":"type: question","color":"d7e102"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":12,"created_at":"2016-07-14T02:02:33Z","updated_at":"2016-07-14T16:55:01Z","closed_at":"2016-07-14T15:52:22Z","body":"I didn't understand one thing. Even though I created a transactional email template on sendgrid.com and referenced it on my code, I had to had a Content object to the Mail object and the message arrived as text/plain (probably because of the Content object).\r\n\r\nHow can I use just the template created on the website?\r\n\r\n```\r\nvar sg = new SendGridAPIClient(\".....\");\r\n\r\n\r\n            var from = new Email(\"contato@site.com.br\", \"Name\");\r\n            String subject = \"The subject\";\r\n            var to = new Email(txtEmail.Text, txtNome.Text);\r\n\r\n            var mail = new Mail();\r\n            mail.TemplateId = \"...........\";\r\n            var content = new Content();\r\n            content.Type = \"text/plain\";\r\n            content.Value = \"Textual content\";\r\n            mail.AddContent(content);\r\n            \r\n            \r\n            var memStream = new MemoryStream();\r\n            openFileDialog1.OpenFile().CopyTo(memStream);\r\n            String file = Convert.ToBase64String(memStream.ToArray());\r\n\r\n            var attachment = new Attachment();\r\n            attachment.Filename = \"file.pdf\";\r\n            attachment.Content = file;\r\n            attachment.Type = \"application/pdf\";\r\n            attachment.Disposition = \"attachment\";\r\n            attachment.ContentId = \"certificado\";\r\n            mail.AddAttachment(attachment);\r\n\r\n            var personalization = new Personalization();\r\n            personalization.Tos = new List<Email>();\r\n            personalization.Tos.Add(to);\r\n            personalization.AddSubstitution(\"%NOME%\", txtNome.Text);\r\n            mail.AddPersonalization(personalization);\r\n            mail.From = from;\r\n            mail.Subject = subject;\r\n            \r\n            dynamic response = sg.client.mail.send.post(requestBody: mail.Get());\r\n```"},"comment":{"url":"https://api.github.com/repos/sendgrid/sendgrid-csharp/issues/comments/232725364","html_url":"https://github.com/sendgrid/sendgrid-csharp/issues/272#issuecomment-232725364","issue_url":"https://api.github.com/repos/sendgrid/sendgrid-csharp/issues/272","id":232725364,"user":{"login":"Jimwaga","id":10913742,"avatar_url":"https://avatars.githubusercontent.com/u/10913742?v=3","gravatar_id":"","url":"https://api.github.com/users/Jimwaga","html_url":"https://github.com/Jimwaga","followers_url":"https://api.github.com/users/Jimwaga/followers","following_url":"https://api.github.com/users/Jimwaga/following{/other_user}","gists_url":"https://api.github.com/users/Jimwaga/gists{/gist_id}","starred_url":"https://api.github.com/users/Jimwaga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jimwaga/subscriptions","organizations_url":"https://api.github.com/users/Jimwaga/orgs","repos_url":"https://api.github.com/users/Jimwaga/repos","events_url":"https://api.github.com/users/Jimwaga/events{/privacy}","received_events_url":"https://api.github.com/users/Jimwaga/received_events","type":"User","site_admin":false},"created_at":"2016-07-14T16:55:01Z","updated_at":"2016-07-14T16:55:01Z","body":"                                                                                      Hi Elmer, Really appreciate it, will continue monitoring and supporting whenever I can . I've dropped the guys an email regarding the shirt. :D Best regards Dennis                                                                                                                                                                                                                                                                                                                                        Sent from my BlackBerry 10 smartphone.                                                                                                                                                                                                                From: Elmer ThomasSent: Thursday, 14 July 2016 23:52To: sendgrid/sendgrid-csharpReply To: sendgrid/sendgrid-csharpCc: Dennis Jimwaga; MentionSubject: Re: [sendgrid/sendgrid-csharp] How to send e-mail using template (#272)Within days, the requirement for including content when you have a template defined will be removed. \n\n@Jimwaga \n\nThanks for the help! Please email dx@sendgrid.com with your T-shirt size and mailing address so we can send you some swag!\n\n—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or mute the thread."}}
{"actor":{"display_login":"Jimwaga"}}