Created
March 17, 2019 09:20
-
-
Save makyol/040d6e02c90584c43a4bf04525fed0bf to your computer and use it in GitHub Desktop.
Small Python script to programmatically subscribe people to your Sendy.co email list
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
import requests | |
import pandas as pd | |
import time | |
csv_file_path = "list.csv" # csv with no header, two cols(name, email) | |
list_id = 'V99999999999999' # from sendy | |
sendy_url = 'https://homepage_of_your_sendy/' | |
data = pd.read_csv(csv_file_path, header=None, sep=";") | |
for index, row in data.iterrows(): | |
payload = { | |
'name': row[0], | |
'email': row[1], | |
'list': list_id, | |
'boolean': True | |
} | |
print(payload) | |
r = requests.post(sendy_url+"subscribe", data=payload) | |
print(r.status_code, r.reason) | |
time.sleep(2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment