mailer-log 0.1.4 → 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: 53e392cc0814b660324d0e0c15eb2e495db0a088d95c220a616910d086f25337
4
- data.tar.gz: dad01fde647453de9bec1ba62ab4b56c6282cc796c5dc43e60d8914b74ccc4e2
3
+ metadata.gz: 246ac2bdc7be2049ccdf70145045c59b6e812b5fc1e15e55c34e27d7a9d355a7
4
+ data.tar.gz: ad4d87236c3317f50782b0036aef15b3b82fb0ad148619085ef76d4e83706cb6
5
5
  SHA512:
6
- metadata.gz: b0bc20cdbf4a202f20affbd44df45a21d9b401a7a69ca097d0da6d3ec16a3f20f8b418d6958a61f69497f55e2761c7ffc09103935ddb8b6fc1a57a3c910aafea
7
- data.tar.gz: 51ec6e61df1eace358a67b24d7289d1bb265276c8f549f45bcf69567a717558dbc6e71e861435dd5e00278cb4a4ab496bbddef5e50d150731587c98670d71af7
6
+ metadata.gz: 33943c05863643d2c1777cf7815722842f300676a862911832061fb2d3dd32c9cbc69eb195780362eb58cac4f14420d25ab495aafe963ef267137c4f5ef1af3d
7
+ data.tar.gz: 43e5dadcc5baa827305b13c17d04bab4bdc41a5fb1d73b163f58a9bd62c2c46978062aa79fb609ee0975e9a4623f4a5982979f41ba60b7e84c2e0b5f0fea9eef
data/CHANGELOG.md CHANGED
@@ -5,6 +5,35 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.1.6] - 2025-12-15
9
+
10
+ ### Added
11
+
12
+ - Configurable `mount_path` option (default: `/admin/mailer-log`)
13
+ - `MailerLog.routes(self)` helper method for easier route mounting
14
+
15
+ ## [0.1.5] - 2025-12-15
16
+
17
+ ### Added
18
+
19
+ - Shim file `lib/mailer-log.rb` for auto-require (no more `require: 'mailer_log'` needed in Gemfile)
20
+
21
+ ### Fixed
22
+
23
+ - Updated README with correct paths and documentation
24
+
25
+ ## [0.1.4] - 2025-12-15
26
+
27
+ ### Added
28
+
29
+ - Date range picker with presets (Today, This week, Last week, This month, Last month)
30
+ - Tooltips for long email addresses in detail panel
31
+
32
+ ### Changed
33
+
34
+ - Improved email detail panel layout (From/To stacked vertically, mailer info aligned right)
35
+ - Close button moved to left side with back arrow icon
36
+
8
37
  ## [0.1.0] - 2024-12-14
9
38
 
10
39
  ### Added
data/README.md CHANGED
@@ -17,7 +17,7 @@ Rails engine for logging all outgoing emails with Mailgun webhook integration.
17
17
  ### 1. Add to Gemfile
18
18
 
19
19
  ```ruby
20
- gem 'mailer_log'
20
+ gem 'mailer-log'
21
21
  ```
22
22
 
23
23
  ### 2. Run install generator
@@ -37,10 +37,16 @@ This will:
37
37
  ```ruby
38
38
  # config/routes.rb
39
39
  Rails.application.routes.draw do
40
- mount MailerLog::Engine, at: '/mailer_log'
40
+ MailerLog.routes(self, at: '/admin/email_log')
41
41
  end
42
42
  ```
43
43
 
44
+ Or mount manually:
45
+
46
+ ```ruby
47
+ mount MailerLog::Engine, at: '/admin/email_log'
48
+ ```
49
+
44
50
  ### 4. Build the frontend (if needed)
45
51
 
46
52
  The engine includes pre-built Vue.js frontend assets. If you need to rebuild:
@@ -61,6 +67,9 @@ Edit `config/initializers/mailer_log.rb` to customize settings:
61
67
 
62
68
  ```ruby
63
69
  MailerLog.configure do |config|
70
+ # Mount path for the engine (default: '/admin/mailer-log')
71
+ # config.mount_path = '/admin/mailer-log'
72
+
64
73
  # Email retention period (default 1 year)
65
74
  config.retention_period = 1.year
66
75
 
@@ -95,7 +104,7 @@ end
95
104
 
96
105
  1. In Mailgun Dashboard, go to **Webhooks**
97
106
  2. Add webhook for each event:
98
- - URL: `https://your-app.com/admin/email_log/webhooks/mailgun`
107
+ - URL: `https://your-app.com/admin/mailer-log/webhooks/mailgun` (adjust path based on your mount_path)
99
108
  - Events: `delivered`, `opened`, `clicked`, `bounced`, `failed`, `dropped`, `complained`
100
109
 
101
110
  ### 3. For Each Domain
@@ -106,11 +115,12 @@ If using multiple domains (white-label), configure webhooks for each.
106
115
 
107
116
  ### Admin UI
108
117
 
109
- After installation, accessible at: `/admin/email_log/admin/emails`
118
+ After installation, accessible at the mounted path (e.g., `/mailer_log` based on routes example above).
110
119
 
111
120
  **Features:**
112
121
  - List of all sent emails with pagination
113
- - Filtering by: recipient, sender, subject, mailer class, status, date
122
+ - Filtering by: recipient, sender, subject, mailer class, status
123
+ - Date range picker with presets (Today, This week, Last week, This month, Last month)
114
124
  - Email details view: headers, body preview, delivery events
115
125
  - Call stack view (where in code the email was triggered)
116
126
 
@@ -170,6 +180,7 @@ cleanup_mailer_log:
170
180
 
171
181
  | Parameter | Default | Description |
172
182
  |-----------|---------|-------------|
183
+ | `mount_path` | `'/admin/mailer-log'` | Default path for `MailerLog.routes(self)` when `at:` not specified |
173
184
  | `retention_period` | `1.year` | Email retention period |
174
185
  | `webhook_signing_key` | `nil` | Key for Mailgun webhook verification |
175
186
  | `capture_call_stack` | `true` | Capture call stack |
@@ -177,6 +188,20 @@ cleanup_mailer_log:
177
188
  | `admin_layout` | `'application'` | Layout for admin views |
178
189
  | `per_page` | `25` | Records per page |
179
190
 
191
+ ## Using as letter_opener Replacement
192
+
193
+ MailerLog can replace `letter_opener_web` for staging environments. Since MailerLog captures emails **before** delivery (via ActionMailer interceptor), you can use `:test` delivery method to prevent actual sending while still logging all emails.
194
+
195
+ ```ruby
196
+ # config/environments/staging.rb
197
+ Rails.application.configure do
198
+ # Use :test so emails are not sent, but MailerLog still captures them
199
+ config.action_mailer.delivery_method = :test
200
+ end
201
+ ```
202
+
203
+ This gives you a full email log UI with filtering, search, and body preview without sending real emails.
204
+
180
205
  ## Troubleshooting
181
206
 
182
207
  ### Emails Not Being Saved
@@ -12,13 +12,19 @@ Next steps:
12
12
  2. Add routes to config/routes.rb:
13
13
 
14
14
  Rails.application.routes.draw do
15
- mount MailerLog::Engine, at: '/mailer_log'
15
+ MailerLog.routes(self, at: '/admin/email_log')
16
+ end
17
+
18
+ Or mount manually:
19
+
20
+ Rails.application.routes.draw do
21
+ mount MailerLog::Engine, at: '/admin/email_log'
16
22
  end
17
23
 
18
24
  3. Configure Mailgun webhooks (optional, for delivery tracking):
19
25
 
20
26
  - Go to Mailgun Dashboard -> Sending -> Webhooks
21
- - Add webhook URL: https://your-app.com/mailer_log/webhooks/mailgun
27
+ - Add webhook URL: https://your-app.com/admin/mailer-log/webhooks/mailgun
22
28
  - Select events: delivered, opened, clicked, bounced, failed, complained
23
29
  - Copy webhook signing key to ENV['MAILGUN_WEBHOOK_SIGNING_KEY']
24
30
 
@@ -29,7 +35,7 @@ Next steps:
29
35
  cron: '0 3 * * *'
30
36
  class: MailerLog::CleanupJob
31
37
 
32
- 5. Access admin UI at: /mailer_log/admin/emails
38
+ 5. Access admin UI at: /admin/mailer-log (or your configured mount_path)
33
39
 
34
40
  ===============================================================================
35
41
 
@@ -1,6 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  MailerLog.configure do |config|
4
+ # Mount path for the engine (default: '/admin/mailer-log')
5
+ # Used when calling MailerLog.routes(self) in config/routes.rb
6
+ # config.mount_path = '/admin/mailer-log'
7
+
4
8
  # Email retention period (default: 1 year)
5
9
  # Emails older than this will be deleted by CleanupJob
6
10
  config.retention_period = 1.year
data/lib/mailer-log.rb ADDED
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Shim file to allow `gem 'mailer-log'` without `require: 'mailer_log'`
4
+ # Bundler auto-requires based on gem name, so this redirects to the actual file.
5
+ require_relative 'mailer_log'
@@ -3,11 +3,12 @@
3
3
  module MailerLog
4
4
  class Configuration
5
5
  attr_accessor :retention_period,
6
- :webhook_signing_key,
7
- :capture_call_stack,
8
- :call_stack_depth,
9
- :admin_layout,
10
- :per_page
6
+ :webhook_signing_key,
7
+ :capture_call_stack,
8
+ :call_stack_depth,
9
+ :admin_layout,
10
+ :per_page,
11
+ :mount_path
11
12
 
12
13
  attr_reader :authenticate_with_proc, :resolve_accountable_proc
13
14
 
@@ -18,6 +19,7 @@ module MailerLog
18
19
  @call_stack_depth = 20
19
20
  @admin_layout = 'application'
20
21
  @per_page = 25
22
+ @mount_path = '/admin/mailer-log'
21
23
  @authenticate_with_proc = nil
22
24
  @resolve_accountable_proc = nil
23
25
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MailerLog
4
- VERSION = '0.1.4'
4
+ VERSION = '0.1.6'
5
5
  end
data/lib/mailer_log.rb CHANGED
@@ -20,5 +20,15 @@ module MailerLog
20
20
  def reset_configuration!
21
21
  @configuration = Configuration.new
22
22
  end
23
+
24
+ # Mount engine routes
25
+ # Usage in config/routes.rb:
26
+ # MailerLog.routes(self, at: '/admin/email_log')
27
+ # Or use configured mount_path:
28
+ # MailerLog.routes(self) # uses config.mount_path (default: /admin/mailer-log)
29
+ def routes(router, at: nil)
30
+ path = at || configuration.mount_path
31
+ router.mount Engine, at: path
32
+ end
23
33
  end
24
34
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mailer-log
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - TrafficRunners
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-12-14 00:00:00.000000000 Z
11
+ date: 2025-12-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: has_scope
@@ -62,7 +62,7 @@ description: A Rails engine that captures all outgoing emails, stores them in Po
62
62
  provides a Vue.js admin UI for browsing emails, and tracks delivery events via Mailgun
63
63
  webhooks.
64
64
  email:
65
- - team@localviking.com
65
+ - sk@trafficrunners.net
66
66
  executables: []
67
67
  extensions: []
68
68
  extra_rdoc_files: []
@@ -93,6 +93,7 @@ files:
93
93
  - lib/generators/mailer_log/install/templates/README
94
94
  - lib/generators/mailer_log/install/templates/create_mailer_log_tables.rb.tt
95
95
  - lib/generators/mailer_log/install/templates/initializer.rb.tt
96
+ - lib/mailer-log.rb
96
97
  - lib/mailer_log.rb
97
98
  - lib/mailer_log/configuration.rb
98
99
  - lib/mailer_log/engine.rb