Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save artemgordinskiy/e71c67b8cbc5a2eef7dfebbf44b302e7 to your computer and use it in GitHub Desktop.
Save artemgordinskiy/e71c67b8cbc5a2eef7dfebbf44b302e7 to your computer and use it in GitHub Desktop.
Trigger Customer.io event with attachments in Python
import base64
import requests
from customerio import CustomerIO
file_content = requests.get(file_url).content
file_base64 = base64.b64encode(file_content)
customer_io = CustomerIO(site_id, api_key)
customer_io.track(
customer_id=1,
name='send_diz_shit',
attachments={'some.pdf': file_base64}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment