https://github.com/sparkpost/sparkpost-csv2tx
BASH script to import a CSV and convert it to a Recipient List and delivery a Transmission with SparkPost.
https://github.com/sparkpost/sparkpost-csv2tx
Last synced: 11 months ago
JSON representation
BASH script to import a CSV and convert it to a Recipient List and delivery a Transmission with SparkPost.
- Host: GitHub
- URL: https://github.com/sparkpost/sparkpost-csv2tx
- Owner: SparkPost
- License: bsd-3-clause
- Created: 2014-11-12T00:09:47.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-07-02T18:49:11.000Z (almost 11 years ago)
- Last Synced: 2025-05-21T08:48:49.576Z (about 1 year ago)
- Language: Shell
- Size: 126 KB
- Stars: 3
- Watchers: 17
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
BASH-Import-Script
==================
BASH script to import a CSV and convert it to a Recipient List and deliver a Transmission to the respective recipients using a Template you have stored in SparkPost.
## How to use this
1. Clone the repository
```
git clone https://github.com/SparkPost/sparkpost-csv2tx.git
```
2. Add your information into the "testPeople.csv" using the headers (first row) as a guide
3. Have your SparkPost API Key handy. Need to create a key? Visit: [SparkPost-Creating an API Key](https://sparkpost.com/docs/create-api-key).
4. Create a template in SparkPost (either using the API or the UI). The ID is the "name" of the template.
5. Run the following command from the command line:
```
sh ./csv2tx.sh testPeople
```
This script will:
* Parse the .csv file
* Create JSON which can be used to create a Recipient List Object in SparkPost
* Translates "recipient_email_address" to "address"
* Translates ALL OTHER FIELDS into "substitution_data" (lowercases all the keys)
* Creates a new Recipient List with the provided information
* Uses the ID of the newly created Recipient List object in addition to the Template ID you provide to send a transmission using SparkPost
## Issues and Contributing
Please use the Github Issue Tracker (https://github.com/SparkPost/sparkpost-csv2tx/issues) if you find issues.
Please fork this repository and submit pull requests if you would like to contribute to the source code.
### Author
Message Systems Inc
## License
BSD Clause 3, see the LICENSE file for the complete license information