Skip to content

Instantly share code, notes, and snippets.

@gsherman
Created June 2, 2014 18:55
Show Gist options
  • Save gsherman/2559e7cd005fa4affbfb to your computer and use it in GitHub Desktop.
Save gsherman/2559e7cd005fa4affbfb to your computer and use it in GitHub Desktop.
Batch file for sending a Net Promoter Score survey to a customer using Delighted (delightedapp.com)
@echo off
set Count=0
for %%a in (%*) do set /a Count+=1
if %count% NEQ 3 goto usage
c:
cd %~dp0
SET recipient=%1
SET data=email=%recipient%
SET data2=properties[contactObjid]=%2
SET data3=properties[customerType]=%3
SET apiKey=YourPrivateKeyGoesHere
:sendMessage
C:\bin\curl https://api.delightedapp.com/v1/people.json -u %apiKey%: --data-urlencode %data% --data-urlencode %data2% --data-urlencode %data3%
goto done
:usage
echo.
echo Invalid usage
echo Usage: send-survey emailAddress contactObjid customerType
echo.
:done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment