ElasticEmail 4.2.0 โ†’ 4.4.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '06992cb5829185504ab14ef86658dbcec7017bc89ab3be8d7488ee92d989acce'
4
- data.tar.gz: b2b1d3bfb7e5ec9feeea50d7190b717139a1548ab0efcaac36f210107e558e2e
3
+ metadata.gz: 9470d9689fcf9c6e65c1f44be797ab27561bd5bcd98fb0b6baf35d6e210e4e16
4
+ data.tar.gz: d95732e383fcca6800e5609743054143063a90e7f408b68496d13b53e5d100a0
5
5
  SHA512:
6
- metadata.gz: 4398e5c24377380692390953090991d298d502cb0f6b207e2df933580808a61dd2e60f90309b8dc852e44d83043ca092e15aed9a15329000baed6f58b94e90d7
7
- data.tar.gz: 2048a4b9c2fbd556eaa4eb91ca0416de6517313cab1edd57d5fc5b82297f333a50c67e762b08fbaa4b3483677e1fe30593fac6acd433210b1826c056b54e0f0f
6
+ metadata.gz: 214c80b3c7b460233b9ccdf72756f35628c35f5b68990e5097fb7fb5b7ead366dd15269be80ff73c617f4cf752585514e117ebcafde40f6748d81ff89b2a660c
7
+ data.tar.gz: 9775b6796a85898870e941131e0c6f7b5f076588e9936725e5e7d3b73f051005497fe52aee536f75fdd01122cff105942b70ae1ea295f5d2f730bbac7218b6f6
@@ -0,0 +1,132 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our
6
+ community a harassment-free experience for everyone, regardless of age, body
7
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
8
+ identity and expression, level of experience, education, socio-economic status,
9
+ nationality, personal appearance, race, caste, color, religion, or sexual
10
+ identity and orientation.
11
+
12
+ We pledge to act and interact in ways that contribute to an open, welcoming,
13
+ diverse, inclusive, and healthy community.
14
+
15
+ ## Our Standards
16
+
17
+ Examples of behavior that contributes to a positive environment for our
18
+ community include:
19
+
20
+ * Demonstrating empathy and kindness toward other people
21
+ * Being respectful of differing opinions, viewpoints, and experiences
22
+ * Giving and gracefully accepting constructive feedback
23
+ * Accepting responsibility and apologizing to those affected by our mistakes,
24
+ and learning from the experience
25
+ * Focusing on what is best not just for us as individuals, but for the overall
26
+ community
27
+
28
+ Examples of unacceptable behavior include:
29
+
30
+ * The use of sexualized language or imagery, and sexual attention or advances of
31
+ any kind
32
+ * Trolling, insulting or derogatory comments, and personal or political attacks
33
+ * Public or private harassment
34
+ * Publishing others' private information, such as a physical or email address,
35
+ without their explicit permission
36
+ * Other conduct which could reasonably be considered inappropriate in a
37
+ professional setting
38
+
39
+ ## Enforcement Responsibilities
40
+
41
+ Community leaders are responsible for clarifying and enforcing our standards of
42
+ acceptable behavior and will take appropriate and fair corrective action in
43
+ response to any behavior that they deem inappropriate, threatening, offensive,
44
+ or harmful.
45
+
46
+ Community leaders have the right and responsibility to remove, edit, or reject
47
+ comments, commits, code, wiki edits, issues, and other contributions that are
48
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
49
+ decisions when appropriate.
50
+
51
+ ## Scope
52
+
53
+ This Code of Conduct applies within all community spaces, and also applies when
54
+ an individual is officially representing the community in public spaces.
55
+ Examples of representing our community include using an official e-mail address,
56
+ posting via an official social media account, or acting as an appointed
57
+ representative at an online or offline event.
58
+
59
+ ## Enforcement
60
+
61
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
+ reported to the community leaders responsible for enforcement at
63
+ **integrations@elasticemail.com**.
64
+ All complaints will be reviewed and investigated promptly and fairly.
65
+
66
+ All community leaders are obligated to respect the privacy and security of the
67
+ reporter of any incident.
68
+
69
+ ## Enforcement Guidelines
70
+
71
+ Community leaders will follow these Community Impact Guidelines in determining
72
+ the consequences for any action they deem in violation of this Code of Conduct:
73
+
74
+ ### 1. Correction
75
+
76
+ **Community Impact**: Use of inappropriate language or other behavior deemed
77
+ unprofessional or unwelcome in the community.
78
+
79
+ **Consequence**: A private, written warning from community leaders, providing
80
+ clarity around the nature of the violation and an explanation of why the
81
+ behavior was inappropriate. A public apology may be requested.
82
+
83
+ ### 2. Warning
84
+
85
+ **Community Impact**: A violation through a single incident or series of
86
+ actions.
87
+
88
+ **Consequence**: A warning with consequences for continued behavior. No
89
+ interaction with the people involved, including unsolicited interaction with
90
+ those enforcing the Code of Conduct, for a specified period of time. This
91
+ includes avoiding interactions in community spaces as well as external channels
92
+ like social media. Violating these terms may lead to a temporary or permanent
93
+ ban.
94
+
95
+ ### 3. Temporary Ban
96
+
97
+ **Community Impact**: A serious violation of community standards, including
98
+ sustained inappropriate behavior.
99
+
100
+ **Consequence**: A temporary ban from any sort of interaction or public
101
+ communication with the community for a specified period of time. No public or
102
+ private interaction with the people involved, including unsolicited interaction
103
+ with those enforcing the Code of Conduct, is allowed during this period.
104
+ Violating these terms may lead to a permanent ban.
105
+
106
+ ### 4. Permanent Ban
107
+
108
+ **Community Impact**: Demonstrating a pattern of violation of community
109
+ standards, including sustained inappropriate behavior, harassment of an
110
+ individual, or aggression toward or disparagement of classes of individuals.
111
+
112
+ **Consequence**: A permanent ban from any sort of public interaction within the
113
+ community.
114
+
115
+ ## Attribution
116
+
117
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118
+ version 2.1, available at
119
+ [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
120
+
121
+ Community Impact Guidelines were inspired by
122
+ [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
123
+
124
+ For answers to common questions about this code of conduct, see the FAQ at
125
+ [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
126
+ [https://www.contributor-covenant.org/translations][translations].
127
+
128
+ [homepage]: https://www.contributor-covenant.org
129
+ [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
130
+ [Mozilla CoC]: https://github.com/mozilla/diversity
131
+ [FAQ]: https://www.contributor-covenant.org/faq
132
+ [translations]: https://www.contributor-covenant.org/translations
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,76 @@
1
+ # Contributing to the Elastic Email Ruby SDK
2
+
3
+ Thanks for taking the time to contribute! This document explains how to report problems, suggest changes and submit pull requests.
4
+
5
+ ## Before you start: this SDK is generated
6
+
7
+ Almost everything in this repository (`lib/ElasticEmail/api`, `lib/ElasticEmail/models`, the client files in `lib/ElasticEmail`, `spec/`, `docs/` and most of `README.md`) is generated by [OpenAPI Generator](https://openapi-generator.tech) from the Elastic Email API specification.
8
+
9
+ This means:
10
+
11
+ - **Manual edits to generated files will be overwritten** by the next release.
12
+ - If an endpoint, model, parameter or description is wrong or missing, the fix belongs in the API specification. Please [open an issue](https://github.com/ElasticEmail/elasticemail-ruby/issues/new/choose) describing the problem. We'll fix it upstream and regenerate the SDK.
13
+ - Pull requests are most useful for non-generated content: documentation, examples, tests, build and CI configuration, and repository tooling.
14
+
15
+ If you're not sure whether something is generated, open an issue first and ask.
16
+
17
+ ## Reporting bugs
18
+
19
+ Search [existing issues](https://github.com/ElasticEmail/elasticemail-ruby/issues) first. If nothing matches, open a new issue using the **Bug report** template and include:
20
+
21
+ - SDK version (from RubyGems, e.g. `4.4.0`; run `gem list ElasticEmail`)
22
+ - Ruby version (`ruby -v`)
23
+ - The API method you called and a minimal code sample
24
+ - The full error message, HTTP status code and response body (`ElasticEmail::ApiError#code` and `#response_body`)
25
+
26
+ **Never paste your API key** into an issue, log or code sample.
27
+
28
+ Questions about your Elastic Email account, sending limits, deliverability or billing aren't handled in this repository. The preferred way to get help is the **chat widget on [elasticemail.com](https://elasticemail.com)**.
29
+
30
+ Looking for sample code? See the [Elastic Email examples repository](https://github.com/ElasticEmail/elasticemail-examples), including the [Ruby examples](https://github.com/ElasticEmail/elasticemail-examples/tree/main/ruby-elasticemail-examples).
31
+
32
+ ## Suggesting features
33
+
34
+ Open an issue using the **Feature request** template. Describe the use case first and the solution second. It helps us decide whether the change belongs in the API, the SDK or the documentation.
35
+
36
+ ## Security issues
37
+
38
+ Please do **not** report security vulnerabilities in public issues. See [SECURITY.md](SECURITY.md).
39
+
40
+ ## Development setup
41
+
42
+ Requirements: Ruby 2.7 or later and [Bundler](https://bundler.io).
43
+
44
+ ```bash
45
+ git clone https://github.com/ElasticEmail/elasticemail-ruby.git
46
+ cd elasticemail-ruby
47
+ bundle install
48
+ bundle exec rspec
49
+ ```
50
+
51
+ To build and install the gem locally:
52
+
53
+ ```bash
54
+ gem build ElasticEmail.gemspec
55
+ gem install ./ElasticEmail-4.4.0.gem
56
+ ```
57
+
58
+ Keep the gem compatible with Ruby 2.7 and don't add new runtime dependencies without discussing it in an issue first.
59
+
60
+ ## Pull requests
61
+
62
+ 1. Fork the repository and create a branch from `master` (`git checkout -b fix/short-description`).
63
+ 2. Keep each change focused. One logical change per pull request.
64
+ 3. Make sure `bundle exec rspec` and `gem build ElasticEmail.gemspec` pass.
65
+ 4. Update documentation if your change affects how the SDK is used.
66
+ 5. Open a pull request against `master` and fill in the template.
67
+
68
+ A maintainer will review your pull request and may ask for changes. When a change touches generated code, we may apply it upstream instead of merging the PR directly. You'll still get credit in the release notes.
69
+
70
+ ## Code of Conduct
71
+
72
+ This project follows the [Contributor Covenant Code of Conduct](CODE_OF_CONDUCT.md). By participating, you agree to uphold it.
73
+
74
+ ## License
75
+
76
+ By contributing, you agree that your contributions will be licensed under the [MIT License](LICENSE).
Binary file
data/ElasticEmail.gemspec CHANGED
@@ -24,7 +24,7 @@ Gem::Specification.new do |s|
24
24
  s.homepage = "https://elasticemail.com"
25
25
  s.summary = "Elastic Email REST API Ruby Gem"
26
26
  s.description = "The Ruby library for the Elastic Email REST API. This API is based on the REST API architecture, allowing the user to easily manage their data with this resource-based approach. To start using this API, you will need your Access Token. Remember to keep it safe."
27
- s.license = "Unlicense"
27
+ s.license = "MIT"
28
28
  s.required_ruby_version = ">= 2.7"
29
29
  s.metadata = {}
30
30
 
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021-2026 Elastic Email
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md CHANGED
@@ -1,94 +1,206 @@
1
- # ElasticEmail
1
+ <div align="center">
2
2
 
3
- ElasticEmail - the Ruby gem for the Elastic Email REST API
3
+ <img src=".github/ee-logo.png" alt="Elastic Email" width="96" />
4
4
 
5
- This API is based on the REST API architecture, allowing the user to easily manage their data with this resource-based approach.
6
-
7
- Every API call is established on which specific request type (GET, POST, PUT, DELETE) will be used.
8
-
9
- The API has a limit of 20 concurrent connections and a hard timeout of 600 seconds per request.
10
-
11
- To start using this API, you will need your Access Token (available <a target='_blank' href='https://app.elasticemail.com/marketing/settings/new/manage-api'>here</a>). Remember to keep it safe. Required access levels are listed in the given requestโ€™s description.
12
-
13
- Downloadable library clients can be found in our Github repository <a target='_blank' href='https://github.com/ElasticEmail/elasticemail-ruby'>here</a>
5
+ # Elastic Email Ruby SDK
14
6
 
15
- This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
7
+ The official Ruby client library for the [Elastic Email](https://elasticemail.com) REST API v4.
16
8
 
17
- - API version: 4.0.0
18
- - Package version: 4.2.0
19
- - Generator version: 7.11.0
20
- - Build package: org.openapitools.codegen.languages.RubyClientCodegen
9
+ [![RubyGems](https://img.shields.io/gem/v/ElasticEmail?logo=rubygems&logoColor=white&label=RubyGems&color=E9573F)](https://rubygems.org/gems/ElasticEmail)
10
+ [![RubyGems downloads](https://img.shields.io/gem/dt/ElasticEmail?logo=rubygems&logoColor=white&label=downloads&color=E9573F)](https://rubygems.org/gems/ElasticEmail)
11
+ [![Ruby](https://img.shields.io/badge/Ruby-2.7%2B-CC342D?logo=ruby&logoColor=white)](https://www.ruby-lang.org/en/downloads/branches/)
12
+ [![API](https://img.shields.io/badge/API-v4-0A7BBB)](https://elasticemail.com/developers/api-documentation/rest-api)
13
+ [![OpenAPI Generator](https://img.shields.io/badge/generated%20by-OpenAPI%20Generator-6BA539?logo=openapiinitiative&logoColor=white)](https://openapi-generator.tech)
14
+ [![License: MIT](https://img.shields.io/github/license/ElasticEmail/elasticemail-ruby?color=yellow)](LICENSE)
21
15
 
22
- ## Installation
16
+ [![Latest release](https://img.shields.io/github/v/release/ElasticEmail/elasticemail-ruby?logo=github&label=release)](https://github.com/ElasticEmail/elasticemail-ruby/releases)
17
+ [![Last commit](https://img.shields.io/github/last-commit/ElasticEmail/elasticemail-ruby?logo=github)](https://github.com/ElasticEmail/elasticemail-ruby/commits/master)
18
+ [![Open issues](https://img.shields.io/github/issues/ElasticEmail/elasticemail-ruby?logo=github)](https://github.com/ElasticEmail/elasticemail-ruby/issues)
19
+ [![GitHub stars](https://img.shields.io/github/stars/ElasticEmail/elasticemail-ruby?style=flat&logo=github)](https://github.com/ElasticEmail/elasticemail-ruby/stargazers)
23
20
 
24
- ### Build a gem
21
+ [Installation](#installation) โ€ข
22
+ [Quick start](#quick-start) โ€ข
23
+ [Examples](#more-examples) โ€ข
24
+ [API reference](#api-reference) โ€ข
25
+ [Models](#models) โ€ข
26
+ [Contributing](#contributing)
25
27
 
26
- To build the Ruby code into a gem:
28
+ </div>
27
29
 
28
- ```shell
29
- gem build ElasticEmail.gemspec
30
- ```
30
+ ---
31
31
 
32
- Then either install the gem locally:
32
+ ## Features
33
33
 
34
- ```shell
35
- gem install ./ElasticEmail-4.2.0.gem
36
- ```
34
+ - **Transactional and bulk email.** Send single messages, bulk campaigns or CSV merge-file sends.
35
+ - **Safe retries.** Pass an optional `Idempotency-Key` to a send, so a retried request returns the first result instead of sending the email twice.
36
+ - **Contacts, lists and segments.** Add, update, import, export and bulk-delete contacts.
37
+ - **Campaigns and automations.** Create, update, pause and trigger automations for a contact.
38
+ - **Templates, files and attachments.** Manage templates and uploaded files.
39
+ - **Domains.** Verify sending domains and check SPF, DKIM, tracking and certificate status.
40
+ - **Webhooks and inbound routes.** Receive delivery events, optionally signed with HMAC-SHA256 and sent as JSON, and route incoming mail.
41
+ - **Statistics, events and suppressions.** Track delivery, bounces, complaints and unsubscribes.
42
+ - **Subaccounts and security.** Manage subaccounts and API keys.
43
+ - **Plain Ruby objects.** Models are built from keyword hashes with snake_case keys, and every call has a `โ€ฆ_with_http_info` variant that also returns the status code and headers.
37
44
 
38
- (for development, run `gem install --dev ./ElasticEmail-4.2.0.gem` to install the development dependencies)
45
+ ## Requirements
39
46
 
40
- or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
47
+ | Dependency | Version |
48
+ | --- | --- |
49
+ | Ruby | 2.7 or later |
50
+ | [Typhoeus](https://rubygems.org/gems/typhoeus) | `~> 1.0` (installed automatically) |
41
51
 
42
- Finally add this to the Gemfile:
52
+ You'll also need an Elastic Email **API key**. You can create one in your [API settings](https://app.elasticemail.com/marketing/settings/new/manage-api). Each endpoint's documentation lists the access level it needs.
43
53
 
44
- gem 'ElasticEmail', '~> 4.2.0'
54
+ ## Installation
45
55
 
46
- ### Install from Git
56
+ Install the [`ElasticEmail`](https://rubygems.org/gems/ElasticEmail) gem from RubyGems:
47
57
 
48
- If the Ruby gem is hosted at a git repository: https://github.com/elasticemail/elasticemail-ruby, then add the following in the Gemfile:
58
+ ```bash
59
+ gem install ElasticEmail
60
+ ```
49
61
 
50
- gem 'ElasticEmail', :git => 'https://github.com/elasticemail/elasticemail-ruby.git'
62
+ Or add it to your `Gemfile`:
51
63
 
52
- ### Include the Ruby code directly
64
+ ```ruby
65
+ gem 'ElasticEmail', '~> 4.4'
66
+ ```
53
67
 
54
- Include the Ruby code directly using `-I` as follows:
68
+ and run `bundle install`. RubyGems installs the dependency ([Typhoeus](https://rubygems.org/gems/typhoeus)) for you.
55
69
 
56
- ```shell
57
- ruby -Ilib script.rb
58
- ```
70
+ ## Quick start
59
71
 
60
- ## Getting Started
72
+ > [!IMPORTANT]
73
+ > Elastic Email only sends from verified domains. Before your first send, [verify your sending domain](https://help.elasticemail.com/en/articles/4934400-how-to-verify-your-domain) and use an address on that domain as the sender.
61
74
 
62
- Please follow the [installation](#installation) procedure and then run the following code:
75
+ ### Configure the client
63
76
 
64
77
  ```ruby
65
- # Load the gem
66
78
  require 'ElasticEmail'
67
79
 
68
- # Setup authorization
69
80
  ElasticEmail.configure do |config|
70
- # Configure API key authorization: apikey
71
- config.api_key['X-ElasticEmail-ApiKey'] = 'YOUR API KEY'
72
- # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
73
- # config.api_key_prefix['X-ElasticEmail-ApiKey'] = 'Bearer'
81
+ config.api_key['X-ElasticEmail-ApiKey'] = ENV.fetch('ELASTICEMAIL_API_KEY')
74
82
  end
83
+ ```
75
84
 
76
- api_instance = ElasticEmail::CampaignsApi.new
77
- name = 'name_example' # String |
78
- contact_email = 'contact_email_example' # String |
85
+ > [!TIP]
86
+ > Keep your API key out of source code. Load it from an environment variable, Rails credentials or a secrets manager.
87
+
88
+ ### Send a transactional email
89
+
90
+ ```ruby
91
+ emails = ElasticEmail::EmailsApi.new
92
+
93
+ message = ElasticEmail::EmailTransactionalMessageData.new(
94
+ recipients: ElasticEmail::TransactionalRecipient.new(to: ['john.doe@example.com']),
95
+ content: ElasticEmail::EmailContent.new(
96
+ from: 'My App <no-reply@yourdomain.com>',
97
+ subject: 'Welcome aboard!',
98
+ body: [
99
+ ElasticEmail::BodyPart.new(content_type: ElasticEmail::BodyContentType::HTML, content: '<h1>Hello!</h1><p>Thanks for signing up.</p>'),
100
+ ElasticEmail::BodyPart.new(content_type: ElasticEmail::BodyContentType::PLAIN_TEXT, content: 'Hello! Thanks for signing up.')
101
+ ]
102
+ )
103
+ )
79
104
 
80
105
  begin
81
- #Trigger Automation for Contact
82
- api_instance.campaigns_automation_by_name_trigger_post(name, contact_email)
106
+ result = emails.emails_transactional_post(message)
107
+ puts "Sent. TransactionID: #{result.transaction_id}, MessageID: #{result.message_id}"
83
108
  rescue ElasticEmail::ApiError => e
84
- puts "Exception when calling CampaignsApi->campaigns_automation_by_name_trigger_post: #{e}"
109
+ puts "Elastic Email API error #{e.code}: #{e.response_body}"
110
+ end
111
+ ```
112
+
113
+ The `from` address must use a domain you've [verified in your Elastic Email account](https://help.elasticemail.com/en/articles/4934400-how-to-verify-your-domain).
114
+
115
+ ### Retry a send safely (Idempotency-Key)
116
+
117
+ ```ruby
118
+ require 'securerandom'
119
+
120
+ # One key per logical send. Reuse it only when you retry this same send.
121
+ idempotency_key = SecureRandom.uuid
122
+
123
+ # After a timeout or connection error, call this again with the same message and the same key.
124
+ result = emails.emails_transactional_post(message, idempotency_key: idempotency_key)
125
+ puts "TransactionID: #{result.transaction_id}"
126
+ ```
127
+
128
+ If the same key arrives again with the same request within 24 hours, Elastic Email returns the stored response of the first one (same `TransactionID` and `MessageID`, plus an `Idempotency-Replayed: true` response header) and doesn't send or charge again. Retry with an identical body: the same key with a different body gets `422`, and a retry while the first request is still running gets `409`. A `503` means the key couldn't be checked, so wait for the `Retry-After` seconds and retry with the same key. `emails_post` and `emails_mergefile_post` take the same `idempotency_key:` option, and sends without a key work as before.
129
+
130
+ ### Send from a template with merge fields
131
+
132
+ ```ruby
133
+ message = ElasticEmail::EmailTransactionalMessageData.new(
134
+ recipients: ElasticEmail::TransactionalRecipient.new(to: ['john.doe@example.com']),
135
+ content: ElasticEmail::EmailContent.new(
136
+ from: 'My App <no-reply@yourdomain.com>',
137
+ template_name: 'welcome-template',
138
+ merge: { 'firstname' => 'John' }
139
+ )
140
+ )
141
+
142
+ emails.emails_transactional_post(message)
143
+ ```
144
+
145
+ ### Timeouts, debugging and SSL
146
+
147
+ ```ruby
148
+ ElasticEmail.configure do |config|
149
+ config.timeout = 30 # seconds; 0 (default) means no timeout
150
+ config.debugging = true # log requests and responses to config.logger
151
+ config.ssl_ca_cert = '/path/to/ca-bundle.crt'
85
152
  end
153
+ ```
154
+
155
+ ### Create a signed webhook
156
+
157
+ Webhooks can sign every request with HMAC-SHA256 and send events as a `POST` with a JSON body. Both options are set when you create the webhook and can't be changed later. Webhooks created without them keep working as unsigned `GET` requests.
86
158
 
159
+ ```ruby
160
+ webhooks = ElasticEmail::WebhookApi.new
161
+
162
+ payload = ElasticEmail::WebhookCreatePayload.new(
163
+ name: 'my-webhook',
164
+ url: 'https://your-app.example.com/webhook',
165
+ notification_for_sent: true,
166
+ notification_for_opened: true,
167
+ notification_for_clicked: true,
168
+ enable_signing: true,
169
+ delivery_method: ElasticEmail::WebhookDeliveryMethod::POST_JSON
170
+ )
171
+
172
+ webhook = webhooks.webhook_post(payload)
173
+ # Returned only now: store it, e.g. as ELASTICEMAIL_WEBHOOK_SECRET.
174
+ puts webhook.signing_secret
87
175
  ```
88
176
 
177
+ `SigningSecret` is returned only when the webhook is created and when you rotate it with `webhook_by_publicid_secret_rotate_post`, so store it right away. Each signed request carries `X-ElasticEmail-Timestamp` and `X-ElasticEmail-Signature: v1=<hex>`, where the signature is `hex(HMAC-SHA256(secret, "{timestamp}\n{METHOD}\n{path and query}\n{raw body}"))`. Verify it against the raw body before you parse the JSON, reject timestamps more than 5 minutes old, and compare in constant time. The [webhooks guide](https://github.com/ElasticEmail/elasticemail-examples/blob/main/docs/webhooks.md) and the [examples repository](https://github.com/ElasticEmail/elasticemail-examples) have ready-made handlers.
178
+
179
+ ## More examples
180
+
181
+ More complete, runnable samples are in the **[Elastic Email examples repository](https://github.com/ElasticEmail/elasticemail-examples)**. It covers transactional email, SMTP, webhooks, inbound email, contacts and serverless platforms across 20+ languages and frameworks.
182
+
183
+ - ๐Ÿ’Ž [Ruby examples](https://github.com/ElasticEmail/elasticemail-examples/tree/main/ruby-elasticemail-examples)
184
+ - ๐Ÿ“‚ [All examples](https://github.com/ElasticEmail/elasticemail-examples)
185
+
186
+ ## Authentication
187
+
188
+ | Scheme | Header | Used for |
189
+ | --- | --- | --- |
190
+ | `apikey` | `X-ElasticEmail-ApiKey` | All standard API calls |
191
+ | `ApiKeyAuthCustomBranding` | `X-Auth-Token` | Custom-branding (white-label) accounts |
192
+
193
+ ## API limits
89
194
 
195
+ - Up to **20 concurrent connections** per account
196
+ - A hard timeout of **600 seconds** per request
90
197
 
91
- All URIs are relative to *https://api.elasticemail.com/v4*
198
+ ## API reference
199
+
200
+ All URIs are relative to `https://api.elasticemail.com/v4`. The SDK covers **115 endpoints** across 16 API classes: `CampaignsApi`, `ContactsApi`, `DomainsApi`, `EmailsApi`, `EventsApi`, `FilesApi`, `InboundRouteApi`, `ListsApi`, `SecurityApi`, `SegmentsApi`, `StatisticsApi`, `SubAccountsApi`, `SuppressionsApi`, `TemplatesApi`, `VerificationsApi` and `WebhookApi`, all in the `ElasticEmail` module.
201
+
202
+ <details>
203
+ <summary><strong>Show all endpoints</strong></summary>
92
204
 
93
205
  Class | Method | HTTP request | Description
94
206
  ------------ | ------------- | ------------- | -------------
@@ -204,11 +316,16 @@ Class | Method | HTTP request | Description
204
316
  *ElasticEmail::WebhookApi* | [**webhook_by_publicid_delete**](docs/WebhookApi.md#webhook_by_publicid_delete) | **DELETE** /webhook/{publicid} | Delete Webhook
205
317
  *ElasticEmail::WebhookApi* | [**webhook_by_publicid_get**](docs/WebhookApi.md#webhook_by_publicid_get) | **GET** /webhook/{publicid} | Load Webhook
206
318
  *ElasticEmail::WebhookApi* | [**webhook_by_publicid_put**](docs/WebhookApi.md#webhook_by_publicid_put) | **PUT** /webhook/{publicid} | Update Webhook
319
+ *ElasticEmail::WebhookApi* | [**webhook_by_publicid_secret_rotate_post**](docs/WebhookApi.md#webhook_by_publicid_secret_rotate_post) | **POST** /webhook/{publicid}/secret/rotate | Rotate Webhook Secret
207
320
  *ElasticEmail::WebhookApi* | [**webhook_get**](docs/WebhookApi.md#webhook_get) | **GET** /webhook | Load Webhooks
208
321
  *ElasticEmail::WebhookApi* | [**webhook_post**](docs/WebhookApi.md#webhook_post) | **POST** /webhook | Add Webhook
209
322
 
323
+ </details>
210
324
 
211
- ## Documentation for Models
325
+ ## Models
326
+
327
+ <details>
328
+ <summary><strong>Show all 99 models</strong></summary>
212
329
 
213
330
  - [ElasticEmail::AccessLevel](docs/AccessLevel.md)
214
331
  - [ElasticEmail::AccountStatusEnum](docs/AccountStatusEnum.md)
@@ -307,24 +424,54 @@ Class | Method | HTTP request | Description
307
424
  - [ElasticEmail::VerificationStatus](docs/VerificationStatus.md)
308
425
  - [ElasticEmail::Webhook](docs/Webhook.md)
309
426
  - [ElasticEmail::WebhookCreatePayload](docs/WebhookCreatePayload.md)
427
+ - [ElasticEmail::WebhookDeliveryMethod](docs/WebhookDeliveryMethod.md)
310
428
  - [ElasticEmail::WebhookUpdatePayload](docs/WebhookUpdatePayload.md)
311
429
 
430
+ </details>
431
+
432
+ ## Tests
433
+
434
+ The `spec/` folder has generated RSpec specs for every API class and model:
435
+
436
+ ```bash
437
+ bundle install
438
+ bundle exec rspec
439
+ ```
440
+
441
+ ## Versioning
442
+
443
+ The SDK follows the Elastic Email API v4. Package versions and release notes are listed on [RubyGems](https://rubygems.org/gems/ElasticEmail/versions) and in [GitHub Releases](https://github.com/ElasticEmail/elasticemail-ruby/releases).
444
+
445
+ <details>
446
+ <summary>Build details</summary>
447
+
448
+ - API version: 4.0.0
449
+ - SDK version: 4.4.0
450
+ - Generator version: 7.11.0
451
+ - Build package: `org.openapitools.codegen.languages.RubyClientCodegen`
452
+
453
+ </details>
312
454
 
313
- ## Documentation for Authorization
455
+ ## Contributing
314
456
 
457
+ Contributions are welcome! Most of this SDK is generated from the Elastic Email OpenAPI specification, so please read [CONTRIBUTING.md](CONTRIBUTING.md) before opening a pull request.
315
458
 
316
- Authentication schemes defined for the API:
317
- ### apikey
459
+ - ๐Ÿ› [Report a bug](https://github.com/ElasticEmail/elasticemail-ruby/issues/new?template=bug_report.md)
460
+ - ๐Ÿ’ก [Request a feature](https://github.com/ElasticEmail/elasticemail-ruby/issues/new?template=feature_request.md)
461
+ - ๐Ÿ”’ [Report a security issue](SECURITY.md)
318
462
 
463
+ This project follows the [Contributor Covenant Code of Conduct](CODE_OF_CONDUCT.md).
319
464
 
320
- - **Type**: API key
321
- - **API key parameter name**: X-ElasticEmail-ApiKey
322
- - **Location**: HTTP header
465
+ ## Support
323
466
 
324
- ### ApiKeyAuthCustomBranding
467
+ > [!IMPORTANT]
468
+ > The fastest way to get help is the **chat widget on [elasticemail.com](https://elasticemail.com)**. Our support team can help with your account, sending, deliverability and API questions.
325
469
 
470
+ - ๐Ÿ’ฌ [Chat with support on elasticemail.com](https://elasticemail.com) (preferred)
471
+ - ๐Ÿ“š [API documentation](https://elasticemail.com/developers/api-documentation/rest-api)
472
+ - ๐Ÿงช [Examples repository](https://github.com/ElasticEmail/elasticemail-examples)
473
+ - ๐Ÿ› [GitHub issues](https://github.com/ElasticEmail/elasticemail-ruby/issues), for bugs in this SDK only
326
474
 
327
- - **Type**: API key
328
- - **API key parameter name**: X-Auth-Token
329
- - **Location**: HTTP header
475
+ ## License
330
476
 
477
+ Released under the [MIT License](LICENSE). Copyright ยฉ 2021โ€“2026 Elastic Email.
data/SECURITY.md ADDED
@@ -0,0 +1,31 @@
1
+ # Security Policy
2
+
3
+ ## Supported versions
4
+
5
+ Security fixes are released for the latest published version of the [`ElasticEmail`](https://rubygems.org/gems/ElasticEmail) gem on RubyGems. Please upgrade to the latest version before reporting an issue.
6
+
7
+ | Version | Supported |
8
+ | ------- | ------------------ |
9
+ | 4.2.x | :white_check_mark: |
10
+ | < 4.2 | :x: |
11
+
12
+ ## Reporting a vulnerability
13
+
14
+ **Please do not open a public GitHub issue for security vulnerabilities.**
15
+
16
+ Report them privately by one of these methods:
17
+
18
+ - [GitHub private vulnerability reporting](https://github.com/ElasticEmail/elasticemail-ruby/security/advisories/new)
19
+ - Email **integrations@elasticemail.com** with the subject `Security: elasticemail-ruby`
20
+
21
+ Please include:
22
+
23
+ - A description of the issue and its impact
24
+ - Steps to reproduce, or a proof of concept
25
+ - The affected SDK version(s)
26
+
27
+ We will acknowledge your report, investigate, and keep you updated on the fix. Please give us reasonable time to release a fix before disclosing the issue publicly.
28
+
29
+ ## API key safety
30
+
31
+ If you think an API key has been exposed (in a commit, log, issue or screenshot), revoke it right away in your [Elastic Email API settings](https://app.elasticemail.com/marketing/settings/new/manage-api) and create a new one.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 4.2.0
1
+ 4.4.0