Skip to content

Commit e8dda2c

Browse files
committed
chore: update topic id and add timestamp to contact imports example
1 parent 37f21f5 commit e8dda2c

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

examples/contact_imports.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
import os
2+
import time
23

34
import resend
45

56
if not os.environ["RESEND_API_KEY"]:
67
raise EnvironmentError("RESEND_API_KEY is missing")
78

9+
ts = int(time.time())
810
csv_path = os.path.join(os.path.dirname(__file__), "contacts.csv")
911
with open(csv_path, "rb") as f:
10-
file_content = f.read()
12+
file_content = f.read().replace(b"steve@example.com,Steve,Wozniak", f"steve+{ts}@example.com,Steve,Wozniak".encode())
1113

1214
create_params: resend.ContactImports.CreateParams = {
1315
"file": file_content,
@@ -26,7 +28,7 @@
2628
"segments": ["60a2ac5e-0774-456e-817d-ebf40f6dba31"],
2729
"topics": [
2830
{
29-
"id": "284edd7e-b042-46dd-b5ee-a8a88a9ec65f",
31+
"id": "6eb54030-9489-4e9c-8de6-cd337c5fef1e",
3032
"subscription": "opt_in",
3133
},
3234
],

0 commit comments

Comments
 (0)