zapsmtp 0.1.5 → 0.1.6

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 00d69f88673856daa4a932cbf520b99c6aa472b56bd19a62d22d4cca9314be47
4
- data.tar.gz: d6766c40f90da24ab729d865cf0fac51223a12f445e40660a342f01d87b3c046
3
+ metadata.gz: cae7070cb04a2c9823d7ec950118c9182de9a0fcbe298343b5c94d5011e1a961
4
+ data.tar.gz: 809376c5f15a4cc3531ee4898db21279099a137b22264dcfaabdbe710efab8f4
5
5
  SHA512:
6
- metadata.gz: c4ba870db4354f3a8fbc7a4e34ffb81f682ebdd38bf1e2f848458474ca06baeba65e04ed3ef135e0972eb1caa017de1306c1c4d4934efaf1d55dfb5a72a3d0b6
7
- data.tar.gz: 247b91a6e1a31fa2398d6081d1f11ceb9bb032b07314fbea682069f6e3fde37a31164d3dc586b2b2377b4fd589d989a6d0b4709aa6faeefbd37c387ded685113
6
+ metadata.gz: 17376004cc08cf377f5fb9cf6693f0d51aee0585cac70f70835dfcbdfae5150d40caadb063dfc7c2d6ce113b957cd02052387231c182d7894606c27121bf46c4
7
+ data.tar.gz: ad2d12a96b56d45e5aed1934a765b01530470e363b7c2eae352ab5d7484d33017f6024b300ee8b34a14c3b1dfd5f0df1a72a48b5fc112d6063b5365b65874848
@@ -68,6 +68,12 @@ module ZapSMTP
68
68
  # @return [Resources::Variables]
69
69
  attr_reader :variables
70
70
 
71
+ # @return [Resources::EmailValidations]
72
+ attr_reader :email_validations
73
+
74
+ # @return [Resources::PlacementTests]
75
+ attr_reader :placement_tests
76
+
71
77
  private
72
78
 
73
79
  def build_resources
@@ -91,6 +97,8 @@ module ZapSMTP
91
97
  @template_timers = Resources::TemplateTimers.new(self)
92
98
  @actions = Resources::Actions.new(self)
93
99
  @variables = Resources::Variables.new(self)
100
+ @email_validations = Resources::EmailValidations.new(self)
101
+ @placement_tests = Resources::PlacementTests.new(self)
94
102
  end
95
103
  end
96
104
  end
@@ -1003,6 +1003,84 @@ module ZapSMTP
1003
1003
  attribute :url
1004
1004
  end
1005
1005
 
1006
+ # EmailValidation, as the API answers it. Fields not listed here are kept too: read them with #[] or
1007
+ # #to_h.
1008
+ class EmailValidation < Model
1009
+ # @!attribute [r] checks
1010
+ # @return [ZapSMTP::Models::EmailValidationChecks]
1011
+ attribute :checks, "EmailValidationChecks"
1012
+ # @!attribute [r] did_you_mean
1013
+ # @return [String, nil]
1014
+ attribute :did_you_mean
1015
+ # @!attribute [r] email
1016
+ # @return [String]
1017
+ attribute :email
1018
+ # @!attribute [r] normalized
1019
+ # @return [String]
1020
+ attribute :normalized
1021
+ # @!attribute [r] object
1022
+ # @return [String]
1023
+ attribute :object
1024
+ # @!attribute [r] reason
1025
+ # @return [String]
1026
+ attribute :reason
1027
+ # @!attribute [r] reasons
1028
+ # @return [Array<String>]
1029
+ attribute :reasons
1030
+ # @!attribute [r] result
1031
+ # @return [String]
1032
+ attribute :result
1033
+ # @!attribute [r] score
1034
+ # @return [Float]
1035
+ attribute :score
1036
+ end
1037
+
1038
+ # EmailValidationChecks, as the API answers it. Fields not listed here are kept too: read them with #[] or
1039
+ # #to_h.
1040
+ class EmailValidationChecks < Model
1041
+ # @!attribute [r] accept_all
1042
+ # @return [Boolean, nil]
1043
+ attribute :accept_all
1044
+ # @!attribute [r] disposable
1045
+ # @return [Boolean]
1046
+ attribute :disposable
1047
+ # @!attribute [r] domain
1048
+ # @return [String]
1049
+ attribute :domain
1050
+ # @!attribute [r] free
1051
+ # @return [Boolean]
1052
+ attribute :free
1053
+ # @!attribute [r] mailbox
1054
+ # @return [String]
1055
+ attribute :mailbox
1056
+ # @!attribute [r] mx
1057
+ # @return [Array<String>]
1058
+ attribute :mx
1059
+ # @!attribute [r] previously_bounced
1060
+ # @return [Boolean]
1061
+ attribute :previously_bounced
1062
+ # @!attribute [r] role
1063
+ # @return [Boolean]
1064
+ attribute :role
1065
+ # @!attribute [r] suppressed
1066
+ # @return [Boolean]
1067
+ attribute :suppressed
1068
+ # @!attribute [r] syntax
1069
+ # @return [Boolean]
1070
+ attribute :syntax
1071
+ end
1072
+
1073
+ # EmailValidationList, as the API answers it. Fields not listed here are kept too: read them with #[] or
1074
+ # #to_h.
1075
+ class EmailValidationList < Model
1076
+ # @!attribute [r] data
1077
+ # @return [Array<ZapSMTP::Models::EmailValidation>]
1078
+ attribute :data, [:array, "EmailValidation"]
1079
+ # @!attribute [r] object
1080
+ # @return [String]
1081
+ attribute :object
1082
+ end
1083
+
1006
1084
  # ForwardDestination, as the API answers it. Fields not listed here are kept too: read them with #[] or
1007
1085
  # #to_h.
1008
1086
  class ForwardDestination < Model
@@ -1435,6 +1513,123 @@ module ZapSMTP
1435
1513
  attribute :suppressed
1436
1514
  end
1437
1515
 
1516
+ # PlacementAuth, as the API answers it. Fields not listed here are kept too: read them with #[] or #to_h.
1517
+ class PlacementAuth < Model
1518
+ # @!attribute [r] dkim
1519
+ # @return [String]
1520
+ attribute :dkim
1521
+ # @!attribute [r] dmarc
1522
+ # @return [String]
1523
+ attribute :dmarc
1524
+ # @!attribute [r] spf
1525
+ # @return [String]
1526
+ attribute :spf
1527
+ end
1528
+
1529
+ # PlacementResult, as the API answers it. Fields not listed here are kept too: read them with #[] or
1530
+ # #to_h.
1531
+ class PlacementResult < Model
1532
+ # @!attribute [r] address
1533
+ # @return [String]
1534
+ attribute :address
1535
+ # @!attribute [r] auth
1536
+ # @return [ZapSMTP::Models::PlacementAuth, nil]
1537
+ attribute :auth, "PlacementAuth"
1538
+ # @!attribute [r] email_id
1539
+ # @return [String, nil]
1540
+ attribute :email_id
1541
+ # @!attribute [r] folder
1542
+ # @return [String, nil]
1543
+ attribute :folder
1544
+ # @!attribute [r] placement
1545
+ # @return [String, nil]
1546
+ attribute :placement
1547
+ # @!attribute [r] provider
1548
+ # @return [String]
1549
+ attribute :provider
1550
+ # @!attribute [r] received_at
1551
+ # @return [String, nil]
1552
+ attribute :received_at
1553
+ end
1554
+
1555
+ # PlacementSummary, as the API answers it. Fields not listed here are kept too: read them with #[] or
1556
+ # #to_h.
1557
+ class PlacementSummary < Model
1558
+ # @!attribute [r] forums
1559
+ # @return [Integer]
1560
+ attribute :forums
1561
+ # @!attribute [r] inbox
1562
+ # @return [Integer]
1563
+ attribute :inbox
1564
+ # @!attribute [r] inbox_rate
1565
+ # @return [Float]
1566
+ attribute :inbox_rate
1567
+ # @!attribute [r] missing
1568
+ # @return [Integer]
1569
+ attribute :missing
1570
+ # @!attribute [r] pending
1571
+ # @return [Integer]
1572
+ attribute :pending
1573
+ # @!attribute [r] primary
1574
+ # @return [Integer]
1575
+ attribute :primary
1576
+ # @!attribute [r] promotions
1577
+ # @return [Integer]
1578
+ attribute :promotions
1579
+ # @!attribute [r] social
1580
+ # @return [Integer]
1581
+ attribute :social
1582
+ # @!attribute [r] spam
1583
+ # @return [Integer]
1584
+ attribute :spam
1585
+ # @!attribute [r] total
1586
+ # @return [Integer]
1587
+ attribute :total
1588
+ # @!attribute [r] updates
1589
+ # @return [Integer]
1590
+ attribute :updates
1591
+ end
1592
+
1593
+ # PlacementTest, as the API answers it. Fields not listed here are kept too: read them with #[] or #to_h.
1594
+ class PlacementTest < Model
1595
+ # @!attribute [r] created_at
1596
+ # @return [String]
1597
+ attribute :created_at
1598
+ # @!attribute [r] ends_at
1599
+ # @return [String]
1600
+ attribute :ends_at
1601
+ # @!attribute [r] finished_at
1602
+ # @return [String, nil]
1603
+ attribute :finished_at
1604
+ # @!attribute [r] from
1605
+ # @return [String, nil]
1606
+ attribute :from
1607
+ # @!attribute [r] id
1608
+ # @return [String]
1609
+ attribute :id
1610
+ # @!attribute [r] mode
1611
+ # @return [String]
1612
+ attribute :mode
1613
+ # @!attribute [r] object
1614
+ # @return [String]
1615
+ attribute :object
1616
+ # @!attribute [r] results
1617
+ # @return [Array<ZapSMTP::Models::PlacementResult>]
1618
+ attribute :results, [:array, "PlacementResult"]
1619
+ # @!attribute [r] status
1620
+ # @return [String]
1621
+ attribute :status
1622
+ # @!attribute [r] subject
1623
+ # @return [String, nil]
1624
+ attribute :subject
1625
+ # @!attribute [r] summary
1626
+ # @return [ZapSMTP::Models::PlacementSummary]
1627
+ attribute :summary, "PlacementSummary"
1628
+ # @!attribute [r] token
1629
+ # @return [String]
1630
+ attribute :token
1631
+ end
1632
+
1438
1633
  # ReceivedEmail, as the API answers it. Fields not listed here are kept too: read them with #[] or #to_h.
1439
1634
  class ReceivedEmail < Model
1440
1635
  # @!attribute [r] action
@@ -2879,5 +2879,146 @@ module ZapSMTP
2879
2879
  )
2880
2880
  end
2881
2881
  end
2882
+
2883
+ # zap.email_validations
2884
+ class EmailValidations
2885
+ # @api private
2886
+ def initialize(client)
2887
+ @client = client
2888
+ end
2889
+
2890
+ # Validate an address.
2891
+ #
2892
+ # Check one address before you send to it: syntax, the domain and its mail servers, throw-away and role
2893
+ # addresses, typos, your suppression list and earlier hard bounces. Any API key; test keys too (nothing
2894
+ # is sent or changed). result: deliverable (every check passed), risky (it may arrive, but sending to it
2895
+ # can hurt your reputation), undeliverable (it will bounce) or unknown (the domain's DNS did not answer:
2896
+ # try again later). reason is the most serious of reasons: invalid_syntax, reserved_domain,
2897
+ # domain_not_found, no_mail_server, mailbox_not_found, previously_bounced (hard bounced on ZapSMTP in
2898
+ # the last 180 days), dns_error, suppressed (on your suppression list), disposable, accept_all,
2899
+ # role_address; ok when there is none. checks.mailbox is exists, not_found, unknown or not_checked.
2900
+ # Nothing is ever sent to the address. did_you_mean suggests a likely intended address when the domain
2901
+ # looks like a typo. Each address counts against your plan's monthly validations (Free 100, Pro 5,000,
2902
+ # Scale 25,000); over it: 429 monthly_quota_exceeded. Results are not stored.
2903
+ #
2904
+ # @param params [Hash] the parameters below, also accepted as keyword arguments
2905
+ # @option params [String] :email The address to check. Required.
2906
+ # @param request_options [Hash] :idempotency_key, :headers, :timeout and :max_retries for this call
2907
+ # @return [ZapSMTP::Models::EmailValidation]
2908
+ def create(params = {}, request_options: {}, **kwargs)
2909
+ @client.request(
2910
+ method: :post,
2911
+ path: "/email-validations",
2912
+ body: Util.params(params, kwargs),
2913
+ model: Models::EmailValidation,
2914
+ request_options: request_options
2915
+ )
2916
+ end
2917
+
2918
+ # Validate up to 100 addresses.
2919
+ #
2920
+ # Check up to 100 addresses in one call; results come back in the order given. Any API key; test keys
2921
+ # too (nothing is sent or changed). Each address counts against the plan's monthly validations; a batch
2922
+ # that would pass the allowance is refused whole.
2923
+ #
2924
+ # @param params [Hash] the parameters below, also accepted as keyword arguments
2925
+ # @option params [Array<String>] :emails 1–100 addresses, each at most 320 characters. Required.
2926
+ # @param request_options [Hash] :idempotency_key, :headers, :timeout and :max_retries for this call
2927
+ # @return [ZapSMTP::Models::EmailValidationList]
2928
+ def create_batch(params = {}, request_options: {}, **kwargs)
2929
+ @client.request(
2930
+ method: :post,
2931
+ path: "/email-validations/batch",
2932
+ body: Util.params(params, kwargs),
2933
+ model: Models::EmailValidationList,
2934
+ request_options: request_options
2935
+ )
2936
+ end
2937
+ end
2938
+
2939
+ # zap.placement_tests
2940
+ class PlacementTests
2941
+ # @api private
2942
+ def initialize(client)
2943
+ @client = client
2944
+ end
2945
+
2946
+ # Start a placement test.
2947
+ #
2948
+ # Start an inbox placement test: see whether a message lands in the inbox, a Gmail tab or spam at the
2949
+ # big mailbox providers. Requires a full-access live key; test keys get 403 test_key_restricted. With a
2950
+ # message (from and content, or a template) one copy goes to each seed mailbox through your account,
2951
+ # like any send (each counts as a sent email; test keys cannot). Without one the test is manual: send
2952
+ # your message to every address in results from anywhere, with token in the subject or text, within 2
2953
+ # hours. ZapSMTP then reads each seed mailbox (Gmail, Outlook, Yahoo and others) and records where the
2954
+ # copy landed: inbox, a Gmail tab (promotions, social, updates, forums), spam, or missing once the test
2955
+ # ends (15 minutes after a send). auth is the provider's own SPF, DKIM and DMARC verdict. status is
2956
+ # running until every seed has an answer or the test ends, then done. summary.inbox_rate = inbox (any
2957
+ # tab) / seeds with an answer. Your plan includes a number of tests a month (Free 1, Pro 10, Scale 50);
2958
+ # over it: 429 monthly_quota_exceeded.
2959
+ #
2960
+ # @param params [Hash] the parameters below, also accepted as keyword arguments
2961
+ # @option params [String] :from Sender on one of your verified domains. Leave out (with template) for a
2962
+ # manual test.
2963
+ # @option params [String] :subject As in Send an email.
2964
+ # @option params [String] :html As in Send an email.
2965
+ # @option params [String] :text As in Send an email.
2966
+ # @option params [Hash] :template A stored template and its variables, as in Send an email.
2967
+ # @option params [Hash{String => String}] :headers Extra headers, as in Send an email.
2968
+ # @option params [Array<Hash>] :tags As in Send an email.
2969
+ # @option params [String] :stream As in Send an email.
2970
+ # @param request_options [Hash] :idempotency_key, :headers, :timeout and :max_retries for this call
2971
+ # @return [ZapSMTP::Models::PlacementTest]
2972
+ def create(params = {}, request_options: {}, **kwargs)
2973
+ @client.request(
2974
+ method: :post,
2975
+ path: "/placement-tests",
2976
+ body: Util.params(params, kwargs),
2977
+ model: Models::PlacementTest,
2978
+ request_options: request_options
2979
+ )
2980
+ end
2981
+
2982
+ # Retrieve a placement test.
2983
+ #
2984
+ # Retrieve a placement test with where each copy landed. Requires a full-access key. ZapSMTP then reads
2985
+ # each seed mailbox (Gmail, Outlook, Yahoo and others) and records where the copy landed: inbox, a Gmail
2986
+ # tab (promotions, social, updates, forums), spam, or missing once the test ends (15 minutes after a
2987
+ # send). auth is the provider's own SPF, DKIM and DMARC verdict. status is running until every seed has
2988
+ # an answer or the test ends, then done. summary.inbox_rate = inbox (any tab) / seeds with an answer.
2989
+ #
2990
+ # @param id [String] The test id.
2991
+ # @param request_options [Hash] :idempotency_key, :headers, :timeout and :max_retries for this call
2992
+ # @return [ZapSMTP::Models::PlacementTest]
2993
+ def get(id, request_options: {})
2994
+ @client.request(
2995
+ method: :get,
2996
+ path: "/placement-tests/#{Util.seg("id", id)}",
2997
+ model: Models::PlacementTest,
2998
+ request_options: request_options
2999
+ )
3000
+ end
3001
+
3002
+ # List placement tests.
3003
+ #
3004
+ # List placement tests, newest first, with cursor pagination. Requires a full-access key. Pass
3005
+ # next_cursor as after for the next page.
3006
+ #
3007
+ # @param params [Hash] the parameters below, also accepted as keyword arguments
3008
+ # @option params [Integer] :limit 1-100. Limits: 422 invalid_parameter otherwise. Default: 20.
3009
+ # @option params [String] :after A test id from next_cursor. Limits: 422 invalid_parameter otherwise.
3010
+ # @param request_options [Hash] :idempotency_key, :headers, :timeout and :max_retries for this call
3011
+ # @return [ZapSMTP::Page<ZapSMTP::Models::PlacementTest>]
3012
+ def list(params = {}, request_options: {}, **kwargs)
3013
+ @client.request_page(
3014
+ method: :get,
3015
+ path: "/placement-tests",
3016
+ query: Util.params(params, kwargs),
3017
+ model: Models::PlacementTest,
3018
+ paging: :cursor,
3019
+ request_options: request_options
3020
+ )
3021
+ end
3022
+ end
2882
3023
  end
2883
3024
  end
@@ -2,5 +2,5 @@
2
2
 
3
3
  module ZapSMTP
4
4
  # Kept in step with the gemspec by the release script.
5
- VERSION = "0.1.5"
5
+ VERSION = "0.1.6"
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zapsmtp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - ZapSMTP
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-11-02 00:00:00.000000000 Z
11
+ date: 2026-11-03 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: 'Send, receive and track email with ZapSMTP: every API operation, safe
14
14
  retries with idempotency keys, paging over every list, webhook signature verification