{"action":"opened","issue":{"url":"https://api.github.com/repos/Microsoft/mail2bug/issues/22","labels_url":"https://api.github.com/repos/Microsoft/mail2bug/issues/22/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/mail2bug/issues/22/comments","events_url":"https://api.github.com/repos/Microsoft/mail2bug/issues/22/events","html_url":"https://github.com/Microsoft/mail2bug/issues/22","id":120151455,"number":22,"title":"Html email loses his formatting","user":{"login":"ericvb","id":3419875,"avatar_url":"https://avatars.githubusercontent.com/u/3419875?v=3","gravatar_id":"","url":"https://api.github.com/users/ericvb","html_url":"https://github.com/ericvb","followers_url":"https://api.github.com/users/ericvb/followers","following_url":"https://api.github.com/users/ericvb/following{/other_user}","gists_url":"https://api.github.com/users/ericvb/gists{/gist_id}","starred_url":"https://api.github.com/users/ericvb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericvb/subscriptions","organizations_url":"https://api.github.com/users/ericvb/orgs","repos_url":"https://api.github.com/users/ericvb/repos","events_url":"https://api.github.com/users/ericvb/events{/privacy}","received_events_url":"https://api.github.com/users/ericvb/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-12-03T11:38:20Z","updated_at":"2015-12-03T11:38:20Z","closed_at":null,"body":"Hi,\r\nYou can use the ##RawMessageBody tag in the configuration file to put the the html aware mailbody into the tfs item.\r\n\r\nBut this is not working flawless because of following code in TFSWorkItemManager:\r\n```\r\n                if (field.FieldDefinition.FieldType == FieldType.Html)\r\n                {\r\n                    value = value.Replace(\"\\n\", \"<br>\");\r\n                }\r\n```\r\nReplace this code by\r\n```\r\n                if (field.FieldDefinition.FieldType == FieldType.Html\r\n                    && !value.StartsWith(\"<html\"))  // don't replace \\n in a value with real html content, it must not be interpreted!\r\n                {\r\n                    value = value.Replace(\"\\n\", \"<br>\");\r\n                }\r\n```\r\nIf requested, I can do a pull request."}}