1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = { "emails": [
9 {
10 "id": "EXAMPLE-SALE",
11 "subject": "RE: your order",
12 "body": "<p>Black Friday: 40% off everything. Shop now!</p>",
13 },
14 {
15 "id": "EXAMPLE-OPTOUT",
16 "subject": "New arrivals are here",
17 "body": "<p>Shop the new collection.</p><p>To unsubscribe, log in to your account. Please allow up to 30 days for removal.</p><p>Example Co, 123 Main Street, Springfield, IL 62701</p>",
18 "headers": { "List-Unsubscribe": "<mailto:unsubscribe@example.com>" },
19 },
20 {
21 "id": "EXAMPLE-NEWS",
22 "subject": "October tips from Example Co",
23 "fromName": "Example Co",
24 "fromEmail": "news@example.com",
25 "body": "<p>Five ways to save energy this winter.</p><p>You're receiving this because you signed up at example.com. <a href='https://example.com/u'>Unsubscribe</a> | Manage preferences</p><p>Example Co, 123 Main Street, Springfield, IL 62701</p>",
26 "headers": {
27 "List-Unsubscribe": "<https://example.com/u/one-click>",
28 "List-Unsubscribe-Post": "List-Unsubscribe=One-Click",
29 },
30 },
31 ] }
32
33
34run = client.actor("ultimatemc/email-can-spam-checker").call(run_input=run_input)
35
36
37print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
38for item in client.dataset(run.default_dataset_id).iterate_items():
39 print(item)
40
41