Skip to content

Instantly share code, notes, and snippets.

@wesgibbs
wesgibbs / Help Scout possible change to body formating
Last active August 19, 2016 20:15
Documentation for troubleshooting the appearance of newline characters in the Help Scout message body
This is a sample payload we post to /conversations.json
"{\"customer\":{\"email\":\"1ANSV69@blackhole.czops.net\"},\"mailbox\":{\"id\":45263},\"reload\":true,\"subject\":\"Test42\",\"tags\":[\"app\"],\"threads\":[{\"body\":\"Test42\\u003Cbr /\\u003E\\u003Cbr /\\u003EWith\\u003Cbr /\\u003E\\u003Cbr /\\u003ELine\\u003Cbr /\\u003EBreaks.\\u003Cbr/\\u003E\\u003Cbr/\\u003E\\u003Cbr/\\u003E-----\\u003Cbr/\\u003ECZDATA\\u003Cbr/\\u003E{\\\"conversation_id\\\":\\\"3TJHJQ\\\",\\\"message_id\\\":\\\"10QHPC5\\\"}\",\"createdBy\":{\"email\":\"1T88N6M@blackhole.czops.net\",\"type\":\"customer\"},\"type\":\"customer\"}]}"
When I curl that conversation
curl -u APIKEY:X https://api.helpscout.net/v:X https://api.helpscout.net/v1/conversations/240823781.json
the "body" returned has newline characters inserted before each HTML break tag. Prior to Aug 18 message bodies did not have those newline charcters.
@wesgibbs
wesgibbs / curl
Last active April 14, 2016 21:44
POST to conversations/id.json
curl -u 123APIKEY:X https://api.helpscout.net/v1/conversations/192267712.json \
-H "Content-Type: application/json" -X POST \
-d "{\"body\":\"<img onload='alert(1010101);' src='https://www.google.com/logos/doodles/2016/pandit-ravi-shankars-96th-birthday-6265541272535040-res.png'\",\"createdBy\":{\"email\":\"1T88N6M@blackhole.czops.net\",\"type\":\"customer\"},\"reload\":true,\"type\":\"customer\"}"
@wesgibbs
wesgibbs / 1_webhook_post.json
Last active November 17, 2015 19:21
Help Scout Webhook modifiedAt parameter
{
"id": 139960307,
"folderId": 504966,
"type": "email",
"isDraft": false,
"number": 2934,
"owner": null,
"mailbox": {
"id": 45263,
"name": "Dev Inbox"
# web_custom_steps.rb
module ClassMatcher
def contains_class(css_class)
"contains(concat(' ',normalize-space(@class),' '),' #{css_class} ')"
end
end
World(ClassMatcher)
ctrl+b
page up
ctrl+f
page down
gg or 1G
top of file
G (shift+g)
def show
render :template => "ui/#{params[:id]}", :layout => false and return if params[:id] == "poll_step_2"
render :template => "ui/#{params[:id]}"
end
puts "\n\n ${1:Variable}: #{${1}} \n\n"