{"action":"created","issue":{"url":"https://api.github.com/repos/davidgohel/ReporteRs/issues/137","repository_url":"https://api.github.com/repos/davidgohel/ReporteRs","labels_url":"https://api.github.com/repos/davidgohel/ReporteRs/issues/137/labels{/name}","comments_url":"https://api.github.com/repos/davidgohel/ReporteRs/issues/137/comments","events_url":"https://api.github.com/repos/davidgohel/ReporteRs/issues/137/events","html_url":"https://github.com/davidgohel/ReporteRs/issues/137","id":171122714,"number":137,"title":"Could writeDoc directly write html code into R for bsdoc object?","user":{"login":"drizztxx","id":8664796,"avatar_url":"https://avatars.githubusercontent.com/u/8664796?v=3","gravatar_id":"","url":"https://api.github.com/users/drizztxx","html_url":"https://github.com/drizztxx","followers_url":"https://api.github.com/users/drizztxx/followers","following_url":"https://api.github.com/users/drizztxx/following{/other_user}","gists_url":"https://api.github.com/users/drizztxx/gists{/gist_id}","starred_url":"https://api.github.com/users/drizztxx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drizztxx/subscriptions","organizations_url":"https://api.github.com/users/drizztxx/orgs","repos_url":"https://api.github.com/users/drizztxx/repos","events_url":"https://api.github.com/users/drizztxx/events{/privacy}","received_events_url":"https://api.github.com/users/drizztxx/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-08-15T07:40:57Z","updated_at":"2016-08-18T01:21:59Z","closed_at":"2016-08-18T01:21:59Z","body":"Hi David,\r\n\r\nI need to send lots of mails with table every week. [mailR](https://github.com/rpremraj/mailR) supports sending HTML formatted mail, so I considered to create mail body via bsdoc in ReporteRs. What I have done is just like:\r\n```\r\nlibrary( ReporteRs )\r\nmydoc = bsdoc( title = 'my document' )\r\nmydoc = addFlexTable( mydoc, vanilla.table(iris[1:10,] ) )\r\nmydoc = addParagraph( mydoc, value = \"Hello World!\" )\r\nwriteDoc( mydoc, file = \"test.html\" )\r\n```\r\n\r\nSince mailR only supports raw html code, I have to read the external file again into R:\r\n```\r\nfileName = 'test.html'\r\nmailbody = readChar(fileName, file.info(fileName)$size)\r\n```\r\n\r\nthen send the mail:\r\n```\r\nrequire(mailR)  \r\nfrom <- \"xxx@xxx.com\"\r\nto <- \"xxx@xxx.com\"\r\nsend.mail(from=from,\r\n          to = to,\r\n          subject = \"Test\",\r\n          body = mailbody,\r\n          smtp = list(host.name = \"xxxx\", post = 25),\r\n          authenticate = F,\r\n          send = T,\r\n          html = T)\r\n```\r\n\r\nMy question is: if ReporteRs can directly output the raw html into R rather than an external file?\r\n\r\nThanks,\r\nDrizzt"},"comment":{"url":"https://api.github.com/repos/davidgohel/ReporteRs/issues/comments/240597823","html_url":"https://github.com/davidgohel/ReporteRs/issues/137#issuecomment-240597823","issue_url":"https://api.github.com/repos/davidgohel/ReporteRs/issues/137","id":240597823,"user":{"login":"drizztxx","id":8664796,"avatar_url":"https://avatars.githubusercontent.com/u/8664796?v=3","gravatar_id":"","url":"https://api.github.com/users/drizztxx","html_url":"https://github.com/drizztxx","followers_url":"https://api.github.com/users/drizztxx/followers","following_url":"https://api.github.com/users/drizztxx/following{/other_user}","gists_url":"https://api.github.com/users/drizztxx/gists{/gist_id}","starred_url":"https://api.github.com/users/drizztxx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drizztxx/subscriptions","organizations_url":"https://api.github.com/users/drizztxx/orgs","repos_url":"https://api.github.com/users/drizztxx/repos","events_url":"https://api.github.com/users/drizztxx/events{/privacy}","received_events_url":"https://api.github.com/users/drizztxx/received_events","type":"User","site_admin":false},"created_at":"2016-08-18T01:21:59Z","updated_at":"2016-08-18T01:21:59Z","body":"Thanks David. It works well for me!"}}
{"actor":{"display_login":"drizztxx"}}