Skip to content

Instantly share code, notes, and snippets.

@ryanermita
Last active May 11, 2020 01:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryanermita/e2d2193493ae76d5809a4e670c55e8fe to your computer and use it in GitHub Desktop.
Save ryanermita/e2d2193493ae76d5809a4e670c55e8fe to your computer and use it in GitHub Desktop.
explore_customer_io_anonymous_email
import requests
import json
import base64
CUSTOMER_IO_SITE_ID='<SITE ID>'
CUSTOMER_IO_API_KEY='<API KEY>'
CUSTOMER_IO_CREDS = f'{CUSTOMER_IO_SITE_ID}:{CUSTOMER_IO_API_KEY}'
CUSTOMER_IO_ENCODED_CREDS = base64.b64encode(CUSTOMER_IO_CREDS.encode()).decode()
def send_verification_email():
url = 'https://track.customer.io/api/v1/events'
headers = {"Authorization": f"Basic {CUSTOMER_IO_ENCODED_CREDS}", "Content-Type": "application/json"}
data = {
"name": "user_email_verification",
"data": {
"otp": "123456",
"source":"backend_service",
"recipient": "ryan.ermita@uploan.ph"
}
}
requests.post(url, data=json.dumps(data), headers=headers, verify=False)
if __name__ == "__main__":
send_verification_email()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment