1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "htmlContent": "<!DOCTYPE html><html><body style='margin:0;padding:0;'><table width='100%' cellpadding='0' cellspacing='0' border='0'><tr><td align='center' style='background:#f4f4f4;padding:20px;'><table width='600' cellpadding='0' cellspacing='0' border='0' style='background:white;'><tr><td align='center'><img src='https://via.placeholder.com/600x200?text=Promo+Banner' alt='Promo Banner' width='600' height='200'></td></tr><tr><td style='padding:20px;text-align:center;'><h2 style='margin-bottom:10px;'>Limited Time Offer!</h2><p style='margin:0 0 20px;'>Get 50% off all subscriptions. Hurry, offer ends soon.</p><a href='https://example.com/deal' style='display:inline-block;padding:12px 24px;background:#28a745;color:white;text-decoration:none;border-radius:5px;'>Claim Offer</a></td></tr></table></td></tr></table></body></html>",
10 "subjectLine": "Your 50% OFF Coupon ๐",
11 "sender": "no-reply@example.com",
12 "targetClients": [
13 "Gmail",
14 "Outlook",
15 "AppleMail",
16 ],
17 "devices": [
18 "desktop",
19 "mobile",
20 ],
21}
22
23
24run = client.actor("rocketagro/html-email-debugger").call(run_input=run_input)
25
26
27print("๐พ Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
28for item in client.dataset(run["defaultDatasetId"]).iterate_items():
29 print(item)
30
31