mailer-log 0.1.5 → 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 +4 -4
- data/CHANGELOG.md +7 -0
- data/README.md +12 -2
- data/lib/generators/mailer_log/install/templates/README +9 -3
- data/lib/generators/mailer_log/install/templates/initializer.rb.tt +4 -0
- data/lib/mailer_log/configuration.rb +7 -5
- data/lib/mailer_log/version.rb +1 -1
- data/lib/mailer_log.rb +10 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 246ac2bdc7be2049ccdf70145045c59b6e812b5fc1e15e55c34e27d7a9d355a7
|
|
4
|
+
data.tar.gz: ad4d87236c3317f50782b0036aef15b3b82fb0ad148619085ef76d4e83706cb6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 33943c05863643d2c1777cf7815722842f300676a862911832061fb2d3dd32c9cbc69eb195780362eb58cac4f14420d25ab495aafe963ef267137c4f5ef1af3d
|
|
7
|
+
data.tar.gz: 43e5dadcc5baa827305b13c17d04bab4bdc41a5fb1d73b163f58a9bd62c2c46978062aa79fb609ee0975e9a4623f4a5982979f41ba60b7e84c2e0b5f0fea9eef
|
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,13 @@ 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
|
+
|
|
8
15
|
## [0.1.5] - 2025-12-15
|
|
9
16
|
|
|
10
17
|
### Added
|
data/README.md
CHANGED
|
@@ -37,10 +37,16 @@ This will:
|
|
|
37
37
|
```ruby
|
|
38
38
|
# config/routes.rb
|
|
39
39
|
Rails.application.routes.draw do
|
|
40
|
-
|
|
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/
|
|
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
|
|
@@ -171,6 +180,7 @@ cleanup_mailer_log:
|
|
|
171
180
|
|
|
172
181
|
| Parameter | Default | Description |
|
|
173
182
|
|-----------|---------|-------------|
|
|
183
|
+
| `mount_path` | `'/admin/mailer-log'` | Default path for `MailerLog.routes(self)` when `at:` not specified |
|
|
174
184
|
| `retention_period` | `1.year` | Email retention period |
|
|
175
185
|
| `webhook_signing_key` | `nil` | Key for Mailgun webhook verification |
|
|
176
186
|
| `capture_call_stack` | `true` | Capture call stack |
|
|
@@ -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
|
-
|
|
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/
|
|
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: /
|
|
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
|
|
@@ -3,11 +3,12 @@
|
|
|
3
3
|
module MailerLog
|
|
4
4
|
class Configuration
|
|
5
5
|
attr_accessor :retention_period,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
data/lib/mailer_log/version.rb
CHANGED
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,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mailer-log
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- TrafficRunners
|
|
@@ -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
|
-
-
|
|
65
|
+
- sk@trafficrunners.net
|
|
66
66
|
executables: []
|
|
67
67
|
extensions: []
|
|
68
68
|
extra_rdoc_files: []
|