1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "mode": "start",
12 "leads": [
13 {
14 "email": "jane@acmecorp.com",
15 "firstName": "Jane",
16 "companyName": "Acme Corp",
17 "servicesOffered": [
18 "SEO",
19 "PPC"
20 ],
21 "summarySnippet": "Full-service digital marketing agency specializing in performance campaigns for e-commerce brands."
22 }
23 ],
24 "emailProvider": "smtp",
25 "smtpHost": "smtp-relay.brevo.com",
26 "smtpUser": "yourlogin@example.com",
27 "smtpPass": "your-smtp-password",
28 "apiKey": "SG.xxxxxxxxxxxxxxxxxxxx",
29 "mailgunDomain": "mail.yourdomain.com",
30 "fromName": "Jane at Acme Corp",
31 "fromEmail": "jane@acmecorp.com",
32 "unsubscribeUrl": "https://yourapp.com/unsubscribe?sid={{sequenceId}}&e={{email}}",
33 "rateLimitPerRun": 100,
34 "emailTemplate": `Hi {{firstName}},
35
36I came across {{companyName}} and was impressed by your work in {{topService}}.
37
38{{summarySnippet}}
39
40I'd love to explore how we might work together. Would you be open to a quick 15-minute call this week?
41
42Best,
43[Your name]
44
45To opt out: {{unsubscribeLink}}`,
46 "subjectLine": "Quick question for {{companyName}}",
47 "kvStoreName": "outreach-sequences"
48};
49
50
51const run = await client.actor("ryanclinton/outreach-sequencer").call(input);
52
53
54console.log('Results from dataset');
55console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
56const { items } = await client.dataset(run.defaultDatasetId).listItems();
57items.forEach((item) => {
58 console.dir(item);
59});
60
61