From 62402739cb32d4b641b013cbce3e5935c6e7c849 Mon Sep 17 00:00:00 2001 From: Yehuda Davis Date: Wed, 6 Dec 2023 23:12:28 -0500 Subject: [PATCH] Fix str vs. bytes error --- pysendpulse/pysendpulse.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pysendpulse/pysendpulse.py b/pysendpulse/pysendpulse.py index 8cc7c22..3d8ece3 100644 --- a/pysendpulse/pysendpulse.py +++ b/pysendpulse/pysendpulse.py @@ -450,7 +450,7 @@ def add_campaign(self, from_email, from_name, subject, body, addressbook_id, cam 'sender_name': from_name, 'sender_email': from_email, 'subject': subject, - 'body': base64.b64encode(body), + 'body': base64.b64encode(body.encode('utf-8')).decode('utf-8'), 'list_id': addressbook_id, 'name': campaign_name, 'attachments': json.dumps(attachments)