mailgun.js 10.2.4 → 10.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/Classes/InboxPlacements/AttributesClient.d.ts +10 -0
  3. package/Classes/InboxPlacements/FiltersClient.d.ts +9 -0
  4. package/Classes/InboxPlacements/Results/InboxPlacementsResultsClient.d.ts +20 -0
  5. package/Classes/InboxPlacements/Results/InboxPlacementsResultsClient.ts +18 -0
  6. package/Classes/InboxPlacements/Results/InboxPlacementsResultsSharing.ts +10 -0
  7. package/Classes/InboxPlacements/Results/InboxPlacementsResultsSharingClient.d.ts +14 -0
  8. package/Classes/InboxPlacements/SeedsLists/AttributesClient.d.ts +10 -0
  9. package/Classes/InboxPlacements/SeedsLists/FiltersClient.d.ts +8 -0
  10. package/Classes/InboxPlacements/SeedsLists/SeedsListsClient.d.ts +21 -0
  11. package/Classes/InboxPlacements/inboxPlacements.d.ts +13 -0
  12. package/Classes/InboxPlacements/providers/InboxPlacementsProviders.d.ts +10 -0
  13. package/Classes/MailgunClient.d.ts +2 -1
  14. package/Interfaces/InboxPlacements/AttributesClient.d.ts +5 -0
  15. package/Interfaces/InboxPlacements/FiltersClient.d.ts +4 -0
  16. package/Interfaces/InboxPlacements/InboxPlacementsClient.d.ts +10 -0
  17. package/Interfaces/InboxPlacements/Results/InboxPlacementsResults.d.ts +13 -0
  18. package/Interfaces/InboxPlacements/Results/InboxPlacementsResultsClient.d.ts +8 -0
  19. package/Interfaces/InboxPlacements/Results/InboxPlacementsResultsSharing.d.ts +5 -0
  20. package/Interfaces/InboxPlacements/SeedsLists/AttributesClient.d.ts +5 -0
  21. package/Interfaces/InboxPlacements/SeedsLists/FiltersClient.d.ts +4 -0
  22. package/Interfaces/InboxPlacements/SeedsLists/SeedsListsClient.d.ts +12 -0
  23. package/Interfaces/InboxPlacements/index.d.ts +6 -0
  24. package/Interfaces/InboxPlacements/providers/InboxPlacementsProviders.d.ts +4 -0
  25. package/Interfaces/MailgunClient/IMailgunClient.d.ts +2 -0
  26. package/Interfaces/index.d.ts +1 -0
  27. package/README.md +972 -2
  28. package/Types/Domains/Domains.d.ts +1 -1
  29. package/Types/InboxPlacements/Attributes.d.ts +21 -0
  30. package/Types/InboxPlacements/Filters.d.ts +18 -0
  31. package/Types/InboxPlacements/InboxPlacements.d.ts +22 -0
  32. package/Types/InboxPlacements/InboxPlacementsClient.d.ts +0 -0
  33. package/Types/InboxPlacements/Results/InboxPlacementsResults.d.ts +152 -0
  34. package/Types/InboxPlacements/Results/InboxPlacementsResultsSharing.d.ts +27 -0
  35. package/Types/InboxPlacements/SeedsLists/SeedsLists.d.ts +137 -0
  36. package/Types/InboxPlacements/index.d.ts +7 -0
  37. package/Types/InboxPlacements/providers/InboxPlacementsProviders.d.ts +23 -0
  38. package/mailgun.node.js +2 -2
  39. package/mailgun.node.js.LICENSE.txt +1 -1
  40. package/mailgun.web.js +2 -2
  41. package/mailgun.web.js.LICENSE.txt +1 -1
  42. package/package.json +1 -1
  43. package/version.md +1 -1
package/README.md CHANGED
@@ -195,6 +195,34 @@ The following service methods are available to instantiated clients. The example
195
195
  - [create](#create-7)
196
196
  - [enable](#enable)
197
197
  - [disable](#disable)
198
+ - [Inbox Placements](#inbox-placements)
199
+ - [SeedsLists](#seedslists)
200
+ - [list](#list-7)
201
+ - [get](#get-9)
202
+ - [create](#create-8)
203
+ - [update](#update-4)
204
+ - [destroy](#destroy-6)
205
+ - [SeedsLists Attributes](#attributes)
206
+ - [list](#list-8)
207
+ - [get](#get-10)
208
+ - [SeedsLists Filters](#filters)
209
+ - [list](#list-9)
210
+ - [Providers](#providers)
211
+ - [list](#list-10)
212
+ - [Results](#results)
213
+ - [list](#list-11)
214
+ - [get](#get-11)
215
+ - [destroy](#destroy-7)
216
+ - [getResultByShareId](#getresultbyshareid)
217
+ - [Results Attributes](#attributes-1)
218
+ - [list](#list-12)
219
+ - [get](#get-12)
220
+ - [Results Filters](#filters-1)
221
+ - [list](#list-13)
222
+ - [Sharing](#sharing)
223
+ - [get](#get-13)
224
+ - [update](#update-5)
225
+ - [Run Test](#run-test)
198
226
  - [Navigation thru lists](#navigation-thru-lists)
199
227
  - [Browser Demo](#browser-demo)
200
228
  - [Development](#development)
@@ -204,7 +232,7 @@ The following service methods are available to instantiated clients. The example
204
232
  - [Release Process](#release-process)
205
233
  - [TODO](#todo)
206
234
 
207
- Method naming conventions:
235
+ ### Method naming conventions:
208
236
  - `get` or `get{{Item}}` - expected response for client is a single object
209
237
  - `list` or `list{{Items}}` - expected response for client is a list of objects
210
238
  - `create` or `create{{Item}}` - expected response for client is a single object
@@ -2197,6 +2225,948 @@ A client to manage members within a specific mailing list.
2197
2225
  { id: "123", name: "foobar", status: "disabled" }
2198
2226
  ```
2199
2227
 
2228
+
2229
+ ### Inbox Placements
2230
+ A client to allows you to see the likely deliverability of your email campaigns.
2231
+ - #### SeedsLists
2232
+
2233
+ - #### list
2234
+ `mg.inboxPlacements.seedsLists.list()`
2235
+
2236
+ Example:
2237
+
2238
+ ```JS
2239
+ mg.inboxPlacements.seedsLists.list()
2240
+ .then(data => console.log(data)) // logs response data
2241
+ .catch(err => console.error(err)); //logs any error
2242
+ ```
2243
+
2244
+ Promise returns: available SeedsLists
2245
+ ```JS
2246
+ {
2247
+ status: 200,
2248
+ items: [
2249
+ {
2250
+ kid: 'kid',
2251
+ ID: 'ID',
2252
+ AccountID: 'AccountID',
2253
+ created_at: new Date('2024-08-09T14:32:57.183Z'),
2254
+ updated_at: new Date('2024-08-09T14:33:57.183Z'),
2255
+ last_result_at: new Date('2024-08-09T14:32:57.183Z'),
2256
+ Seeds: [
2257
+ {
2258
+ AccountID: 'acount id',
2259
+ id: 'seed id',
2260
+ token: 'token',
2261
+ email: 'email',
2262
+ provider: 'provider',
2263
+ sync_state: 'sync_state',
2264
+ local_state: 'local_state',
2265
+ created_at: new Date('2024-08-09T14:32:57.183Z'),
2266
+ updated_at: new Date('2024-08-09T14:32:57.183Z'),
2267
+ message_count: 0,
2268
+ max_email_count_hit_at: new Date('2024-08-09T14:32:57.183Z'),
2269
+ total_msgs: 0,
2270
+ matched_msgs: 0,
2271
+ spam_message: 0,
2272
+ expected_msgs: 0,
2273
+ last_sent_to_at: new Date('2024-08-09T14:32:57.183Z'),
2274
+ last_delivered_at: new Date('2024-08-09T14:32:57.183Z'),
2275
+ account_quality: 0,
2276
+ quality_label: 'quality_label',
2277
+ password: 'password',
2278
+ phone_number: 'phone_number',
2279
+ attributes: {},
2280
+ totp: {
2281
+ secret: 'secret',
2282
+ }
2283
+ },
2284
+ ...
2285
+ ],
2286
+ target_email: 'test_email@test.com',
2287
+ sending_domains: ['test_domain.com'],
2288
+ has_results: true,
2289
+ name: 'test name',
2290
+ seed_filter: 'test filter',
2291
+ mailing_list: 'test mailing_list',
2292
+ CreatedTS: 1723214101728,
2293
+ tags: {
2294
+ sfmc_remote_id: 'test sfmc_remote_id',
2295
+ },
2296
+ delivery_stats: {
2297
+ all: {
2298
+ delivered: 0,
2299
+ missing: 0,
2300
+ pending: 0,
2301
+ spam: 0,
2302
+ inbox: 0,
2303
+ total: 0,
2304
+ provider: 'test provider',
2305
+ categories: {
2306
+ primary: 0,
2307
+ promotions: 0,
2308
+ updates: 0,
2309
+ }
2310
+ }
2311
+ },
2312
+ SeedQuality: 1,
2313
+ is_auto_generated: true,
2314
+ },
2315
+ ...
2316
+ ],
2317
+ paging: {
2318
+ first: 'first_page_link',
2319
+ last: 'last_page_link',
2320
+ next: 'next_page_link',
2321
+ previous: 'previous_page_link',
2322
+ }
2323
+ }
2324
+ ```
2325
+
2326
+ - #### get
2327
+ `mg.inboxPlacements.seedsLists.get(seedsListId)`
2328
+
2329
+ Example:
2330
+
2331
+ ```JS
2332
+ mg.inboxPlacements.seedsLists.get(seedsListId);
2333
+ .then(data => console.log(data)) // logs response data
2334
+ .catch(err => console.error(err)); //logs any error
2335
+ ```
2336
+
2337
+ Promise returns: SeedsLists item by id
2338
+ ```JS
2339
+ {
2340
+ status: 200,
2341
+ kid: 'kid',
2342
+ ID: 'ID',
2343
+ AccountID: 'AccountID',
2344
+ created_at: new Date('2024-08-09T14:32:57.183Z'),
2345
+ updated_at: new Date('2024-08-09T14:33:57.183Z'),
2346
+ last_result_at: new Date('2024-08-09T14:32:57.183Z'),
2347
+ Seeds: [
2348
+ {
2349
+ AccountID: 'acount id',
2350
+ id: 'seed id',
2351
+ token: 'token',
2352
+ email: 'email',
2353
+ provider: 'provider',
2354
+ sync_state: 'sync_state',
2355
+ local_state: 'local_state',
2356
+ created_at: new Date('2024-08-09T14:32:57.183Z'),
2357
+ updated_at: new Date('2024-08-09T14:32:57.183Z'),
2358
+ message_count: 0,
2359
+ max_email_count_hit_at: new Date('2024-08-09T14:32:57.183Z'),
2360
+ total_msgs: 0,
2361
+ matched_msgs: 0,
2362
+ spam_message: 0,
2363
+ expected_msgs: 0,
2364
+ last_sent_to_at: new Date('2024-08-09T14:32:57.183Z'),
2365
+ last_delivered_at: new Date('2024-08-09T14:32:57.183Z'),
2366
+ account_quality: 0,
2367
+ quality_label: 'quality_label',
2368
+ password: 'password',
2369
+ phone_number: 'phone_number',
2370
+ attributes: {},
2371
+ totp: {
2372
+ secret: 'secret',
2373
+ }
2374
+ },
2375
+ ...
2376
+ ],
2377
+ target_email: 'test_email@test.com',
2378
+ sending_domains: ['test_domain.com'],
2379
+ has_results: true,
2380
+ name: 'test name',
2381
+ seed_filter: 'test filter',
2382
+ mailing_list: 'test mailing_list',
2383
+ CreatedTS: 1723214101728,
2384
+ tags: {
2385
+ sfmc_remote_id: 'test sfmc_remote_id',
2386
+ },
2387
+ delivery_stats: {
2388
+ all: {
2389
+ delivered: 0,
2390
+ missing: 0,
2391
+ pending: 0,
2392
+ spam: 0,
2393
+ inbox: 0,
2394
+ total: 0,
2395
+ provider: 'test provider',
2396
+ categories: {
2397
+ primary: 0,
2398
+ promotions: 0,
2399
+ updates: 0,
2400
+ }
2401
+ }
2402
+ },
2403
+ SeedQuality: 1,
2404
+ is_auto_generated: true,
2405
+ }
2406
+ ```
2407
+
2408
+ - #### create
2409
+ ```js
2410
+ mg.inboxPlacements.seedsLists.create({
2411
+ name: 'seedLists name',
2412
+ sending_domains: 'your_sending_domain',
2413
+ seed_filter: 'seed filter',
2414
+ remote_id: 'remote_id'
2415
+ })
2416
+ ```
2417
+
2418
+
2419
+ Example:
2420
+
2421
+ ```JS
2422
+ mg.inboxPlacements.seedsLists.create({
2423
+ sending_domains: 'your_sending_domain',
2424
+ name: 'seedLists name';
2425
+ seed_filter: 'seed filter';
2426
+ remote_id: 'remote_id';
2427
+ });
2428
+ .then(data => console.log(data)) // logs response data
2429
+ .catch(err => console.error(err)); //logs any error
2430
+ ```
2431
+
2432
+ Promise returns: created SeedsLists item
2433
+ ```JS
2434
+ {
2435
+ kid: 'kid',
2436
+ created_at: new Date('2024-08-09T14:32:57.183Z'),
2437
+ updated_at: new Date('2024-08-09T14:32:57.183Z'),
2438
+ last_result_at: new Date('2024-08-09T14:32:57.183Z'),
2439
+ target_email: 'test_email@test.com',
2440
+ sending_domains: [ 'your_sending_domain' ],
2441
+ has_results: false,
2442
+ name: 'seedLists name',
2443
+ seed_filter: 'seed filter',
2444
+ provider_filter: [],
2445
+ mailing_list: 'test_email@test.com',
2446
+ previous_mailing_list: '',
2447
+ tags: {
2448
+ sfmc_remote_id: 'remote_id'
2449
+ },
2450
+ delivery_stats: {
2451
+ all: {
2452
+ delivered: 0,
2453
+ missing: 0,
2454
+ pending: 0,
2455
+ spam: 0,
2456
+ inbox: 0,
2457
+ total: 0,
2458
+ provider: 'all',
2459
+ categories: {}
2460
+ }
2461
+ },
2462
+ is_auto_generated: false,
2463
+ version: 2,
2464
+ Seeds: null,
2465
+ status: 200
2466
+ }
2467
+ ```
2468
+
2469
+ - #### update
2470
+
2471
+ ```JS
2472
+ mg.inboxPlacements.seedsLists.update(seedsListId,{
2473
+ name: 'new seedLists name', // optional
2474
+ provider_filter: 'provider_filter', // optional
2475
+ shuffle: true, // optional
2476
+ sending_domains: 'your_sending_domain' // optional
2477
+ })
2478
+ ```
2479
+
2480
+
2481
+ Example:
2482
+
2483
+ ```JS
2484
+ mg.inboxPlacements.seedsLists.update(seedsListId,{
2485
+ name: 'new seedLists name',
2486
+ provider_filter: 'gmail.com',
2487
+ sending_domains: 'your_sending_domain'
2488
+ })
2489
+ .then(data => console.log(data)) // logs response data
2490
+ .catch(err => console.error(err)); //logs any error
2491
+ ```
2492
+
2493
+ Promise returns: updated SeedsLists item
2494
+ ```JS
2495
+ {
2496
+ kid: '674dcab31169b0619005a9f8',
2497
+ created_at: new Date('2024-08-09T14:32:57.183Z'),
2498
+ updated_at: 2024-12-02T14:59:42.231Z,
2499
+ last_result_at: new Date('2024-08-09T14:32:57.183Z'),
2500
+ target_email: 'test_email@test.com',
2501
+ sending_domains: [ 'your_sending_domain' ],
2502
+ has_results: false,
2503
+ name: 'seedLists name',
2504
+ seed_filter: '.*',
2505
+ provider_filter: ['gmail.com'],
2506
+ mailing_list: 'test_email@test.com',
2507
+ previous_mailing_list: '',
2508
+ tags: {
2509
+ sfmc_remote_id: 'remote_id'
2510
+ },
2511
+ delivery_stats: {
2512
+ all: {
2513
+ delivered: 0,
2514
+ missing: 0,
2515
+ pending: 0,
2516
+ spam: 0,
2517
+ inbox: 0,
2518
+ total: 0,
2519
+ provider: 'all',
2520
+ categories: {}
2521
+ }
2522
+ },
2523
+ is_auto_generated: false,
2524
+ version: 2,
2525
+ Seeds: null,
2526
+ status: 200
2527
+ }
2528
+ ```
2529
+
2530
+ - #### destroy
2531
+ ```js
2532
+ mg.inboxPlacements.seedsLists.destroy(seedsListId)
2533
+ ```
2534
+
2535
+ Example:
2536
+
2537
+ ```JS
2538
+ mg.inboxPlacements.seedsLists.destroy(seedsListId)
2539
+ .then(data => console.log(data)) // logs response data
2540
+ .catch(err => console.error(err)); //logs any error
2541
+ ```
2542
+
2543
+ Promise returns: status object
2544
+ ```JS
2545
+ {
2546
+ status: 200,
2547
+ body: null
2548
+ }
2549
+ ```
2550
+
2551
+ - #### Attributes
2552
+
2553
+ - #### list
2554
+ `mg.inboxPlacements.seedsLists.attributes.list()`
2555
+
2556
+ Example:
2557
+
2558
+ ```JS
2559
+ mg.inboxPlacements.seedsLists.attributes.list()
2560
+ .then(data => console.log(data)) // logs response data
2561
+ .catch(err => console.error(err)); //logs any error
2562
+ ```
2563
+ Promise returns: SeedsLists attributes
2564
+ ```JS
2565
+ {
2566
+ status: 200,
2567
+ items:[{
2568
+ attribute: 'available attribute',
2569
+ values: ['attribute_value', ...]
2570
+ }, ...]
2571
+ }
2572
+ ```
2573
+
2574
+ - #### get
2575
+ `mg.inboxPlacements.attributes.get('attribute_name');`
2576
+
2577
+ Example:
2578
+ ```JS
2579
+ mg.inboxPlacements.seedsLists.attributes.get('attribute_name')
2580
+ .then(data => console.log(data)) // logs response data
2581
+ .catch(err => console.error(err)); //logs any error
2582
+ ```
2583
+ Promise returns: SeedsLists attribute
2584
+ ```JS
2585
+ {
2586
+ status: 200,
2587
+ items: {
2588
+ attribute: 'attribute_name',
2589
+ values: ['attribute_value', ...]
2590
+ }
2591
+ }
2592
+ ```
2593
+
2594
+ - #### Filters
2595
+
2596
+ - #### list
2597
+ `mg.inboxPlacements.seedsLists.filters.list()`
2598
+
2599
+ Example:
2600
+
2601
+ ```JS
2602
+ mg.inboxPlacements.seedsLists.filters.list()
2603
+ .then(data => console.log(data)) // logs response data
2604
+ .catch(err => console.error(err)); //logs any error
2605
+ ```
2606
+ Promise returns: SeedsLists filters
2607
+ ```JS
2608
+ {
2609
+ status: 200,
2610
+ supported_filters:{
2611
+ filters: [
2612
+ {
2613
+ parameter: 'parameter_name',
2614
+ description: 'parameter_description'
2615
+ }, ....
2616
+ ]
2617
+ }
2618
+ }
2619
+ ```
2620
+
2621
+ - #### Providers
2622
+
2623
+ - #### list
2624
+ List all available email providers.
2625
+
2626
+ `mg.inboxPlacements.providers.list()`
2627
+
2628
+ Example:
2629
+
2630
+ ```JS
2631
+ mg.inboxPlacements.providers.list()
2632
+ .then(data => console.log(data)) // logs response data
2633
+ .catch(err => console.error(err)); //logs any error
2634
+ ```
2635
+ Promise returns: providers list
2636
+ ```JS
2637
+ {
2638
+ items: [
2639
+ {
2640
+ domain: 'something.com',
2641
+ region: 'provider region',
2642
+ display_name: 'provider name',
2643
+ created_at: new Date('2024-08-09T14:32:57.183Z'),
2644
+ updated_at: new Date('2024-08-09T14:32:59.183Z')
2645
+ },
2646
+ ...
2647
+ ]
2648
+ }
2649
+ ```
2650
+
2651
+ - #### Results
2652
+
2653
+ - #### list
2654
+ Get the details for all placement test results.
2655
+
2656
+ ```js
2657
+ mg.inboxPlacements.results.list({
2658
+ 'sender': 'sender value', // optional
2659
+ 'subject': 'subject value', // optional
2660
+ 'provider': 'provider value', // optional
2661
+ 'target_email': 'target_email value', // optional
2662
+ 'time_after': new Date('2024-08-09T14:32:57.183Z'), // optional
2663
+ 'time_before': new Date('2024-08-11T14:32:57.183Z'), // optional
2664
+ 'cursor': '', // optional
2665
+ 'sort': '', // optional
2666
+ 'offset': 1, // optional
2667
+ 'ascending': true, // optional
2668
+ 'limit': 5, // optional
2669
+ })
2670
+ ```
2671
+
2672
+ Example:
2673
+
2674
+ ```JS
2675
+ mg.inboxPlacements.results.list({
2676
+ 'sender': 'sender value', // optional
2677
+ 'subject': 'subject value', // optional
2678
+ })
2679
+ .then(data => console.log(data)) // logs response data
2680
+ .catch(err => console.error(err)); //logs any error
2681
+ ```
2682
+ Promise returns: results list
2683
+ ```JS
2684
+ {
2685
+ status: 200,
2686
+ items: [
2687
+ {
2688
+ rid: 'rid_value',
2689
+ result_id: 'result_id_value',
2690
+ AccountID: 'AccountID_value',
2691
+ KeyBoxID: 'KeyBoxID_value',
2692
+ keybox_email: 'keybox_email_value',
2693
+ subject: 'subject_value',
2694
+ sender: 'sender_value',
2695
+ seedlist_name: 'seedlist_name_value',
2696
+ created_at: new Date('2024-08-09T14:32:57.183Z'),
2697
+ updated_at: new Date('2024-08-11T14:32:57.183Z'),
2698
+ status: 'status_value',
2699
+ CreatedTS: 1723214101728,
2700
+ attributes: {
2701
+ attribute_value: 'attribute_value_value'
2702
+ },
2703
+ campaign_id: 'campaign_id_value',
2704
+ sharing_enabled: true,
2705
+ sharing_id: 'sharing_id_value',
2706
+ sharing_expires_at: new Date('2024-08-14T14:32:57.183Z'),
2707
+ Box: {
2708
+ Id: 'box_Id_value',
2709
+ kid: 'box_kid_value',
2710
+ AccountID: 'box_AccountID_value',
2711
+ created_at: new Date('2024-08-11T14:32:57.183Z'),
2712
+ updated_at: new Date('2024-08-12T14:32:57.183Z'),
2713
+ last_result_at: new Date('2024-08-13T14:32:57.183Z'),
2714
+ Seeds: null,
2715
+ target_email: 'box_target_email_value',
2716
+ sending_domains: null,
2717
+ has_results: true,
2718
+ name: 'box_name_value',
2719
+ seed_filter: 'box_seed_filter_value',
2720
+ mailing_list: 'box_mailing_list_value',
2721
+ CreatedTS: 1723214101728,
2722
+ tags: ['tag_value'],
2723
+ SeedQuality: 100,
2724
+ is_auto_generated: true,
2725
+ },
2726
+ seed_results: [{
2727
+ email: 'seed_result_email_value',
2728
+ provider: 'seed_result_provider_value',
2729
+ destination: 'seed_result_destination_value',
2730
+ state: 'seed_result_state_value',
2731
+ originating_ip: 'seed_result_originating_ip_value',
2732
+ tags: ['seed_result_tag_value'],
2733
+ dkim: 'seed_result_dkim_value',
2734
+ spf: 'seed_result_spf_value',
2735
+ dmarc: 'seed_result_dmarc_value',
2736
+ headers: [{
2737
+ key: 'seed_result_header_key_value',
2738
+ value: 'seed_result_header_value_value',
2739
+ }],
2740
+ extensions: {
2741
+ category: 'seed_result_extensions_category_value',
2742
+ }
2743
+ }],
2744
+ spamassassin: {
2745
+ is_spam: false,
2746
+ score: 1,
2747
+ required: 1,
2748
+ rules: [{
2749
+ name: 'rule_name_value',
2750
+ points: 100,
2751
+ short_description: 'short_description_value',
2752
+ long_description: 'long_description_value',
2753
+ }],
2754
+ },
2755
+ delivery_stats: {
2756
+ test_delivery_stat: {
2757
+ delivered: 1,
2758
+ missing: 0,
2759
+ pending: 0,
2760
+ spam: 0,
2761
+ inbox: 0,
2762
+ total: 1,
2763
+ provider: 'provider_value',
2764
+ categories: {
2765
+ primary: 1,
2766
+ updates: 0,
2767
+ }
2768
+ }
2769
+ }
2770
+ }
2771
+ ],
2772
+ pages: {
2773
+ first: '?page=first',
2774
+ last: '?page=last',
2775
+ next: '?page=next',
2776
+ previous: '?page=previous',
2777
+ },
2778
+ }
2779
+ ```
2780
+
2781
+ - #### get
2782
+
2783
+ Get the details for a single result.
2784
+
2785
+ `mg.inboxPlacements.results.get(IBPResultId)`
2786
+
2787
+ Example:
2788
+
2789
+ ```JS
2790
+ mg.inboxPlacements.results.get(IBPResultId);
2791
+ .then(data => console.log(data)) // logs response data
2792
+ .catch(err => console.error(err)); //logs any error
2793
+ ```
2794
+
2795
+ Promise returns: Inbox Placement result item
2796
+ ```JS
2797
+ {
2798
+ status: 200,
2799
+ inboxPlacementResult: {
2800
+ rid: 'rid_value',
2801
+ result_id: 'result_id_value',
2802
+ AccountID: 'AccountID_value',
2803
+ KeyBoxID: 'KeyBoxID_value',
2804
+ keybox_email: 'keybox_email_value',
2805
+ subject: 'subject_value',
2806
+ sender: 'sender_value',
2807
+ seedlist_name: 'seedlist_name_value',
2808
+ created_at: new Date('2024-08-09T14:32:57.183Z'),
2809
+ updated_at: new Date('2024-08-11T14:32:57.183Z'),
2810
+ status: 'status_value',
2811
+ CreatedTS: 1723214101728,
2812
+ attributes: {
2813
+ attribute_value: 'attribute_value_value'
2814
+ },
2815
+ campaign_id: 'campaign_id_value',
2816
+ sharing_enabled: true,
2817
+ sharing_id: 'sharing_id_value',
2818
+ sharing_expires_at: new Date('2024-08-14T14:32:57.183Z'),
2819
+ Box: {
2820
+ Id: 'box_Id_value',
2821
+ kid: 'box_kid_value',
2822
+ AccountID: 'box_AccountID_value',
2823
+ created_at: new Date('2024-08-11T14:32:57.183Z'),
2824
+ updated_at: new Date('2024-08-12T14:32:57.183Z'),
2825
+ last_result_at: new Date('2024-08-13T14:32:57.183Z'),
2826
+ Seeds: null,
2827
+ target_email: 'box_target_email_value',
2828
+ sending_domains: null,
2829
+ has_results: true,
2830
+ name: 'box_name_value',
2831
+ seed_filter: 'box_seed_filter_value',
2832
+ mailing_list: 'box_mailing_list_value',
2833
+ CreatedTS: 1723214101728,
2834
+ tags: ['tag_value'],
2835
+ SeedQuality: 100,
2836
+ is_auto_generated: true,
2837
+ },
2838
+ seed_results: [{
2839
+ email: 'seed_result_email_value',
2840
+ provider: 'seed_result_provider_value',
2841
+ destination: 'seed_result_destination_value',
2842
+ state: 'seed_result_state_value',
2843
+ originating_ip: 'seed_result_originating_ip_value',
2844
+ tags: ['seed_result_tag_value'],
2845
+ dkim: 'seed_result_dkim_value',
2846
+ spf: 'seed_result_spf_value',
2847
+ dmarc: 'seed_result_dmarc_value',
2848
+ headers: [{
2849
+ key: 'seed_result_header_key_value',
2850
+ value: 'seed_result_header_value_value',
2851
+ }],
2852
+ extensions: {
2853
+ category: 'seed_result_extensions_category_value',
2854
+ }
2855
+ }],
2856
+ spamassassin: {
2857
+ is_spam: false,
2858
+ score: 1,
2859
+ required: 1,
2860
+ rules: [{
2861
+ name: 'rule_name_value',
2862
+ points: 100,
2863
+ short_description: 'short_description_value',
2864
+ long_description: 'long_description_value',
2865
+ }],
2866
+ },
2867
+ delivery_stats: {
2868
+ test_delivery_stat: {
2869
+ delivered: 1,
2870
+ missing: 0,
2871
+ pending: 0,
2872
+ spam: 0,
2873
+ inbox: 0,
2874
+ total: 1,
2875
+ provider: 'provider_value',
2876
+ categories: {
2877
+ primary: 1,
2878
+ updates: 0,
2879
+ }
2880
+ }
2881
+ }
2882
+ }
2883
+ }
2884
+ ```
2885
+
2886
+ - #### destroy
2887
+ Delete the result and all associated information.
2888
+
2889
+ `mg.inboxPlacements.results.destroy(IBPResultId)`
2890
+
2891
+ Example:
2892
+
2893
+ ```JS
2894
+ mg.inboxPlacements.results.destroy(IBPResultId)
2895
+ .then(data => console.log(data)) // logs response data
2896
+ .catch(err => console.error(err)); //logs any error
2897
+ ```
2898
+
2899
+ Promise returns: status object
2900
+ ```JS
2901
+ {
2902
+ status: 200,
2903
+ message: 'deleted'
2904
+ }
2905
+ ```
2906
+
2907
+ - #### getResultByShareId
2908
+ Get a result by the share ID.
2909
+ ```js
2910
+ mg.inboxPlacements.results.getResultByShareId('result_sharing_id')
2911
+ ```
2912
+
2913
+ Example:
2914
+
2915
+ ```JS
2916
+ mg.inboxPlacements.results.getResultByShareId('result_sharing_id')
2917
+ .then(data => console.log(data)) // logs response data
2918
+ .catch(err => console.error(err)); //logs any error
2919
+ ```
2920
+
2921
+ Promise returns: Inbox Placement result item
2922
+ ```JS
2923
+ {
2924
+ status: 200,
2925
+ inboxPlacementResult: {
2926
+ rid: 'rid_value',
2927
+ result_id: 'result_id_value',
2928
+ AccountID: 'AccountID_value',
2929
+ KeyBoxID: 'KeyBoxID_value',
2930
+ keybox_email: 'keybox_email_value',
2931
+ subject: 'subject_value',
2932
+ sender: 'sender_value',
2933
+ seedlist_name: 'seedlist_name_value',
2934
+ created_at: new Date('2024-08-09T14:32:57.183Z'),
2935
+ updated_at: new Date('2024-08-11T14:32:57.183Z'),
2936
+ status: 'status_value',
2937
+ CreatedTS: 1723214101728,
2938
+ attributes: {
2939
+ attribute_value: 'attribute_value_value'
2940
+ },
2941
+ campaign_id: 'campaign_id_value',
2942
+ sharing_enabled: true,
2943
+ sharing_id: 'sharing_id_value',
2944
+ sharing_expires_at: new Date('2024-08-14T14:32:57.183Z'),
2945
+ Box: {
2946
+ Id: 'box_Id_value',
2947
+ kid: 'box_kid_value',
2948
+ AccountID: 'box_AccountID_value',
2949
+ created_at: new Date('2024-08-11T14:32:57.183Z'),
2950
+ updated_at: new Date('2024-08-12T14:32:57.183Z'),
2951
+ last_result_at: new Date('2024-08-13T14:32:57.183Z'),
2952
+ Seeds: null,
2953
+ target_email: 'box_target_email_value',
2954
+ sending_domains: null,
2955
+ has_results: true,
2956
+ name: 'box_name_value',
2957
+ seed_filter: 'box_seed_filter_value',
2958
+ mailing_list: 'box_mailing_list_value',
2959
+ CreatedTS: 1723214101728,
2960
+ tags: ['tag_value'],
2961
+ SeedQuality: 100,
2962
+ is_auto_generated: true,
2963
+ },
2964
+ seed_results: [{
2965
+ email: 'seed_result_email_value',
2966
+ provider: 'seed_result_provider_value',
2967
+ destination: 'seed_result_destination_value',
2968
+ state: 'seed_result_state_value',
2969
+ originating_ip: 'seed_result_originating_ip_value',
2970
+ tags: ['seed_result_tag_value'],
2971
+ dkim: 'seed_result_dkim_value',
2972
+ spf: 'seed_result_spf_value',
2973
+ dmarc: 'seed_result_dmarc_value',
2974
+ headers: [{
2975
+ key: 'seed_result_header_key_value',
2976
+ value: 'seed_result_header_value_value',
2977
+ }],
2978
+ extensions: {
2979
+ category: 'seed_result_extensions_category_value',
2980
+ }
2981
+ }],
2982
+ spamassassin: {
2983
+ is_spam: false,
2984
+ score: 1,
2985
+ required: 1,
2986
+ rules: [{
2987
+ name: 'rule_name_value',
2988
+ points: 100,
2989
+ short_description: 'short_description_value',
2990
+ long_description: 'long_description_value',
2991
+ }],
2992
+ },
2993
+ delivery_stats: {
2994
+ test_delivery_stat: {
2995
+ delivered: 1,
2996
+ missing: 0,
2997
+ pending: 0,
2998
+ spam: 0,
2999
+ inbox: 0,
3000
+ total: 1,
3001
+ provider: 'provider_value',
3002
+ categories: {
3003
+ primary: 1,
3004
+ updates: 0,
3005
+ }
3006
+ }
3007
+ }
3008
+ }
3009
+ }
3010
+ ```
3011
+
3012
+ - #### Attributes
3013
+
3014
+ - #### list
3015
+ `mg.inboxPlacements.results.attributes.list()`
3016
+
3017
+ Example:
3018
+
3019
+ ```JS
3020
+ mg.inboxPlacements.results.attributes.list()
3021
+ .then(data => console.log(data)) // logs response data
3022
+ .catch(err => console.error(err)); //logs any error
3023
+ ```
3024
+ Promise returns: results attributes
3025
+ ```JS
3026
+ {
3027
+ status: 200,
3028
+ items:[{
3029
+ attribute: 'available attribute',
3030
+ values: ['attribute_value', ...]
3031
+ }, ...]
3032
+ }
3033
+ ```
3034
+
3035
+ - #### get
3036
+ `mg.inboxPlacements.attributes.get('attribute_name');`
3037
+
3038
+ Example:
3039
+ ```JS
3040
+ mg.inboxPlacements.results.attributes.get('attribute_name')
3041
+ .then(data => console.log(data)) // logs response data
3042
+ .catch(err => console.error(err)); //logs any error
3043
+ ```
3044
+ Promise returns: results attribute
3045
+ ```JS
3046
+ {
3047
+ status: 200,
3048
+ items: {
3049
+ attribute: 'attribute_name',
3050
+ values: ['attribute_value', ...]
3051
+ }
3052
+ }
3053
+ ```
3054
+
3055
+ - #### Filters
3056
+
3057
+ - #### list
3058
+ `mg.inboxPlacements.results.filters.list()`
3059
+
3060
+ Example:
3061
+
3062
+ ```JS
3063
+ mg.inboxPlacements.results.filters.list()
3064
+ .then(data => console.log(data)) // logs response data
3065
+ .catch(err => console.error(err)); //logs any error
3066
+ ```
3067
+ Promise returns: SeedsLists filters
3068
+ ```JS
3069
+ {
3070
+ status: 200,
3071
+ supported_filters:{
3072
+ filters: [
3073
+ {
3074
+ parameter: 'parameter_name',
3075
+ description: 'parameter_description'
3076
+ }, ....
3077
+ ]
3078
+ }
3079
+ }
3080
+ ```
3081
+
3082
+ - #### Sharing
3083
+ - #### get
3084
+ The sharing status of a result.
3085
+
3086
+ `mg.inboxPlacements.results.sharing.get('result_id');`
3087
+ Example:
3088
+ ```JS
3089
+ mg.inboxPlacements.results.sharing.get('result_id');
3090
+ .then(data => console.log(data)) // logs response data
3091
+ .catch(err => console.error(err)); //logs any error
3092
+ ```
3093
+ Promise returns: IPRSharingResult
3094
+ ```JS
3095
+ {
3096
+ status: 200,
3097
+ result_id: 'result_id',
3098
+ expires_at: new Date('2024-08-12T14:32:57.183Z'),
3099
+ enabled: true,
3100
+ url_id: 'result_sharing_id',
3101
+ url: 'url-to-shared-result-page',
3102
+ api_url: 'url-shared-result-page-in-json'
3103
+ }
3104
+ ```
3105
+ - #### update
3106
+ Change the sharing status of a result or create a new share URL
3107
+
3108
+ `mg.inboxPlacements.results.sharing.update('result_id', IPRSharingUpdateData);`
3109
+
3110
+ Example:
3111
+ ```JS
3112
+ mg.inboxPlacements.results.sharing.update('result_id', { enabled: false });
3113
+ .then(data => console.log(data)) // logs response data
3114
+ .catch(err => console.error(err)); //logs any error
3115
+ ```
3116
+ Promise returns: IPRSharingResult
3117
+ ```JS
3118
+ {
3119
+ status: 200,
3120
+ result_id: 'result_id',
3121
+ expires_at: new Date('2024-08-12T14:32:57.183Z'),
3122
+ enabled: false,
3123
+ url_id: 'result_sharing_id',
3124
+ url: '',
3125
+ api_url: ''
3126
+ }
3127
+ ```
3128
+
3129
+ - #### Run test
3130
+ Create and run a new inbox placement test.
3131
+
3132
+ Either 'html' or 'template_name' field should be provided.
3133
+
3134
+ 'variables' are Template variables, which could be used in html or template. You can use next recipient variables inside Template variables, which will be filled for every seed automatically: %recipient.first_name%, %recipient.last_name%.
3135
+
3136
+ `mg.inboxPlacements.runTest(InboxPlacementsData);`
3137
+
3138
+ Example:
3139
+ ```JS
3140
+ mg.inboxPlacements.runTest({
3141
+ from: 'Excited User <mailgun@sandbox-123.mailgun.org>',
3142
+ subject: 'Subject of test email',
3143
+ provider_filter: ['o365.mailgun.email'],
3144
+ html: `<html><body>
3145
+ <h4>Waiting for inbox placements support in mailgun.js SDK?</h4>
3146
+ <h3>We are working on this </h3>
3147
+ </body></html>`,
3148
+ template_name: 'name-of-the-template-you-made-in-mailgun-web-portal';
3149
+ variables: JSON.stringify({
3150
+ 'template_variable_name': 'template_variable_value'
3151
+ },
3152
+ seed_list: 'previously-generated-seed-list',
3153
+ })
3154
+ .then(data => console.log(data)) // logs response data
3155
+ .catch(err => console.error(err)); //logs any error
3156
+ ```
3157
+
3158
+ Promise returns: InboxPlacementsTestResult
3159
+
3160
+ ```JS
3161
+ {
3162
+ status: 200,
3163
+ result_id: 'result_id',
3164
+ links: {
3165
+ results: 'link to result page',
3166
+ }
3167
+ }
3168
+ ```
3169
+
2200
3170
  ## Navigation thru lists
2201
3171
  Most of the methods that return items in a list support pagination.
2202
3172
  There are two ways to receive part of the list:
@@ -2385,7 +3355,7 @@ Demo should be up and running at http://0.0.0.0:4001/examples/
2385
3355
 
2386
3356
  ## Requirements
2387
3357
 
2388
- - Requires node.js >= 4.x
3358
+ - Requires node.js >= 18.x
2389
3359
 
2390
3360
  Install node dependencies with:
2391
3361