Created
June 2, 2014 18:55
-
-
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)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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