mailbox_gem 0.1.0 → 0.1.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 +4 -4
- data/README.md +7 -1
- data/app/controllers/mailbox_gem/messages_controller.rb +4 -1
- data/app/views/mailbox_gem/messages/show.html.erb +22 -22
- data/lib/mailbox_gem/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 010b2c97f9ec4c2f8a206f4ce9a80a5a2d1369ae46ddb243f5bdc80caec777ec
|
|
4
|
+
data.tar.gz: 60d23ed4a710964d32b92335946383d06fdc98990d8fceed3569d5c1c754c3e6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 47ba87dc6910cbbc361a9da5b4e185c1670fe94ba1a482d4582ad1ea8b5849c96f64573e8e88c67e1624fae8f849a669c6ac9b613afbd3e37c46bfdaf433d374
|
|
7
|
+
data.tar.gz: fae3ca99d0a726132bf39655b68c45e84778633728ef73008e395b9dd7e5fd105eeac88a5d2ddc11c69182717287f698abcc6674b0509de7f34941a2b5af60e6
|
data/README.md
CHANGED
|
@@ -12,10 +12,16 @@ MailboxGem is a standalone engine. It doesn't modify Rails or Action Mailer; it
|
|
|
12
12
|
Rails already has two ways to look at outgoing mail in development, and both have a gap:
|
|
13
13
|
|
|
14
14
|
- **`ActionMailer::Preview`** (`/rails/mailers`) renders a mailer against data you construct by hand in a preview class. It never touches your real application code path, so it can drift from what actually gets sent.
|
|
15
|
-
- **`ActionMailer::Base.deliveries`** only accumulates anything when `delivery_method` is `:test`, which is what the `test` environment uses — not `development`. In development there's normally nowhere to look at all.
|
|
15
|
+
- **`ActionMailer::Base.deliveries`** only accumulates anything when `delivery_method` is `:test`, which is what the `test` environment uses — not `development`. In development, there's normally nowhere to look at all.
|
|
16
16
|
|
|
17
17
|
MailboxGem fills that gap: it captures the real `Mail::Message` your app hands to Action Mailer when a user actually triggers an email (signs up, resets a password, checks out), and gives you a live UI to inspect it — HTML, plain text, and raw source, with attachments.
|
|
18
18
|
|
|
19
|
+
## Demo
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
https://github.com/user-attachments/assets/16f82b71-7b6c-47fa-8acc-0dbe147975cd
|
|
23
|
+
|
|
24
|
+
|
|
19
25
|
## Features
|
|
20
26
|
|
|
21
27
|
- **Captures real mail**, not previews — anything delivered through Action Mailer while `mailbox_gem` is the active delivery method.
|
|
@@ -29,7 +29,10 @@ module MailboxGem
|
|
|
29
29
|
private
|
|
30
30
|
|
|
31
31
|
def filtered_messages
|
|
32
|
-
Store.all
|
|
32
|
+
Store.all
|
|
33
|
+
.select { |message| message.matches?(@query) }
|
|
34
|
+
.sort_by { |message| message.captured_at }
|
|
35
|
+
.reverse
|
|
33
36
|
end
|
|
34
37
|
end
|
|
35
38
|
end
|
|
@@ -32,26 +32,26 @@
|
|
|
32
32
|
|
|
33
33
|
<% case @view %>
|
|
34
34
|
<% when "html" %>
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
35
|
+
<iframe
|
|
36
|
+
class="body-frame"
|
|
37
|
+
sandbox="allow-popups allow-popups-to-escape-sandbox allow-top-navigation-by-user-activation"
|
|
38
|
+
title="HTML body"
|
|
39
|
+
referrerpolicy="no-referrer"
|
|
40
|
+
srcdoc="<%= @message.html_body %>"
|
|
41
|
+
>
|
|
42
|
+
</iframe>
|
|
43
|
+
<% when "text" %>
|
|
44
|
+
<pre class="body-text"><%= @message.text_body %></pre>
|
|
45
|
+
<% when "source" %>
|
|
46
|
+
<pre class="body-text"><%= @message.source %></pre>
|
|
47
|
+
<% end %>
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
49
|
+
<% if @message.attachments.any? %>
|
|
50
|
+
<h2>Attachments</h2>
|
|
51
|
+
<ul class="attachments">
|
|
52
|
+
<% @message.attachments.each do |attachment| %>
|
|
53
|
+
<li><%= attachment.filename %>
|
|
54
|
+
<span class="muted">(<%= number_to_human_size(attachment.decoded.bytesize) %>)</span></li>
|
|
55
|
+
<% end %>
|
|
56
|
+
</ul>
|
|
57
|
+
<% end %>
|
data/lib/mailbox_gem/version.rb
CHANGED