goodmail 0.3.0 → 0.3.1

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: 97d19566a8e8eacb10fed28cddfbe7c9f254ae6f4df4b0c2a8ad5259d646631d
4
- data.tar.gz: a15578a0b463e3372ffeff6f9d0a2b0aaa3754c0cf604cc574a97fb0506545fe
3
+ metadata.gz: c91c844f486384162c36ae455e8c41cd282930c6e8e61a8f43ba549a32dbc76d
4
+ data.tar.gz: c7f26ef1b5f58f3803d6611dd9401eea9a150b9dc5f05e9b60a4732114361493
5
5
  SHA512:
6
- metadata.gz: 8ec18e8bc6a78545259c5a359b1811fa7df18cccdca0df36761b94db25304ea9f894ae85cbddbeb54c674526ad7eb5c5a80e24767f7bd97d23baa692ab02aa5f
7
- data.tar.gz: d384ec22ed4107cb20c73deff523e15b3d5dcaf7c3d5a464030024336fde15e6346f5f02f90673e23d6790e085db70782b2a2e0df783dbd7db8ad23908b8e3ff
6
+ metadata.gz: d2c869d81f688f83d04c3fe06060225c60284d9911be34d53a34a8e8fa533c43e241c0a963eee4b2d5459ea7f65aed49dccf77ef4fb3166f444a0a4592dcc697
7
+ data.tar.gz: ff185729ddc066578ee712009ce27ddd36111fbe6ec8331c0fbb62fe59bfd622a329aa9aa0f92ba71905e9c3cc7e8f6207056196a2bc0353bf922873aa61ec4f
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## [0.3.0] - 2025-05-15
2
+ - Add Goodmail.render for custom mailers
3
+
1
4
  ## [0.2.0] - 2025-05-02
2
5
 
3
6
  ### Added
data/README.md CHANGED
@@ -234,6 +234,39 @@ end
234
234
  * **Purpose**: `Goodmail.render` is primarily for generating and retrieving processed email content parts. `Goodmail.compose` is for generating a complete, deliverable `Mail::Message` object.
235
235
  * **List-Unsubscribe Header**: `Goodmail.render` itself does *not* add the `List-Unsubscribe` header to any mail object (as it doesn't create one). If you use `Goodmail.render`, you are responsible for adding this header to your `Mail::Message` object if an `unsubscribe_url` was effectively used during rendering (either passed to `Goodmail.render` or taken from global config) and you require this header. The internal `Goodmail::Mailer` (used by `Goodmail.compose`) handles adding this header automatically to the `Mail::Message` object it builds.
236
236
 
237
+ ### Integrating with the Pay Gem
238
+
239
+ Goodmail works seamlessly with the [Pay gem](https://github.com/pay-rails/pay) to send beautiful transactional emails for payment notifications (receipts, refunds, subscription updates, etc.).
240
+
241
+ Since Pay allows you to configure a custom mailer class, you can create a mailer that uses `Goodmail.render` to generate beautiful email content for all Pay notifications.
242
+
243
+ **Quick Setup:**
244
+
245
+ 1. Copy the example mailer from [`examples/pay_goodmail_mailer.rb`](examples/pay_goodmail_mailer.rb) to your Rails app at `app/mailers/pay_goodmail_mailer.rb`
246
+
247
+ 2. Configure Pay to use the custom mailer in `config/initializers/pay.rb`:
248
+
249
+ ```ruby
250
+ Pay.setup do |config|
251
+ config.parent_mailer = "ApplicationMailer"
252
+ config.mailer = "PayGoodmailMailer"
253
+ # ... other Pay configuration
254
+ end
255
+ ```
256
+
257
+ 3. Customize the email content and URLs in the mailer to match your app
258
+
259
+ The example implementation includes all Pay notification types:
260
+ - `receipt` - Payment receipts
261
+ - `refund` - Refund confirmations
262
+ - `subscription_renewing` - Renewal reminders
263
+ - `payment_action_required` - Payment action needed
264
+ - `subscription_trial_will_end` - Trial ending soon
265
+ - `subscription_trial_ended` - Trial has ended
266
+ - `payment_failed` - Failed payment alerts
267
+
268
+ Each method uses `Goodmail.render` to create beautiful, consistent emails that match your brand.
269
+
237
270
  ### Adding Unsubscribe Functionality
238
271
 
239
272
  Goodmail helps you add the `List-Unsubscribe` header and an optional visible link, but **you must provide the actual URL** where users can unsubscribe.
@@ -39,6 +39,7 @@ module Goodmail
39
39
  @config = DEFAULT_CONFIG.dup unless defined?(@config) && @config
40
40
  @config
41
41
  end
42
+ alias_method :configuration, :config
42
43
 
43
44
  # Resets the configuration back to the default values.
44
45
  # Primarily useful for testing environments.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Goodmail
4
- VERSION = "0.3.0"
4
+ VERSION = "0.3.1"
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: goodmail
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - rameerez
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-05-14 00:00:00.000000000 Z
10
+ date: 2026-02-25 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: rails