Module: PostmarkClient
- Defined in:
- lib/postmark_client.rb,
lib/postmark_client/errors.rb,
lib/postmark_client/version.rb,
lib/postmark_client/client/base.rb,
lib/postmark_client/models/email.rb,
lib/postmark_client/configuration.rb,
lib/postmark_client/resources/emails.rb,
lib/postmark_client/models/attachment.rb,
lib/postmark_client/models/email_response.rb
Overview
PostmarkClient is a Ruby gem for interacting with the Postmark transactional email API. It provides a clean, extensible interface for sending emails via Postmark.
Defined Under Namespace
Modules: Client, Resources Classes: ApiError, Attachment, Configuration, ConfigurationError, ConnectionError, Email, EmailResponse, Error, ValidationError
Constant Summary collapse
- VERSION =
Current version of the PostmarkClient gem
"0.1.0"
Class Attribute Summary collapse
-
.configuration ⇒ Configuration
Get the current configuration, initializing if necessary.
Class Method Summary collapse
-
.configure {|Configuration| ... } ⇒ void
Configure the gem using a block.
-
.deliver(email) ⇒ EmailResponse
Send an email using the default configuration.
-
.emails(api_token: nil) ⇒ Resources::Emails
Convenience method to create an Emails client.
-
.reset_configuration! ⇒ void
Reset the configuration to defaults.
Class Attribute Details
.configuration ⇒ Configuration
Get the current configuration, initializing if necessary
55 56 57 |
# File 'lib/postmark_client/configuration.rb', line 55 def configuration @configuration ||= Configuration.new end |
Class Method Details
.configure {|Configuration| ... } ⇒ void
This method returns an undefined value.
Configure the gem using a block
68 69 70 |
# File 'lib/postmark_client/configuration.rb', line 68 def configure yield(configuration) end |
.deliver(email) ⇒ EmailResponse
Send an email using the default configuration
74 75 76 |
# File 'lib/postmark_client.rb', line 74 def deliver(email) emails.send(email.is_a?(Hash) ? Email.new(**email) : email) end |
.emails(api_token: nil) ⇒ Resources::Emails
Convenience method to create an Emails client
58 59 60 |
# File 'lib/postmark_client.rb', line 58 def emails(api_token: nil) Resources::Emails.new(api_token: api_token) end |
.reset_configuration! ⇒ void
This method returns an undefined value.
Reset the configuration to defaults
75 76 77 |
# File 'lib/postmark_client/configuration.rb', line 75 def reset_configuration! @configuration = Configuration.new end |