Class: Tomba::Verifier

Inherits:
Service show all
Defined in:
lib/tomba/services/verifier.rb

Overview

Verifier service for email verification.

Provides methods to verify if an email address is valid and deliverable.

Instance Method Summary collapse

Methods inherited from Service

#initialize

Constructor Details

This class inherits a constructor from Tomba::Service

Instance Method Details

#email_verifier(email:, webhook_url: nil) ⇒ Hash

Email Verifier

Verifies the deliverability of an email address.

Parameters:

  • email (String)

    the email address to verify

  • webhook_url (String, nil) (defaults to: nil)

    webhook URL for async notifications

Returns:

  • (Hash)

    API response containing verification results

Raises:

See Also:



19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/tomba/services/verifier.rb', line 19

def email_verifier(email:, webhook_url: nil)
  raise Tomba::Exception, 'Missing required parameter: "email"' if email.nil?

  path = '/email-verifier'

  params = {}
  params[:email] = email unless email.nil?
  params[:webhook_url] = webhook_url unless webhook_url.nil?

  @client.call('get', path, {
                 'content-type' => 'application/json'
               }, params)
end