emailbutler 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +13 -2
- data/app/assets/stylesheets/emailbutler/views/dashboard.scss +37 -19
- data/app/controllers/emailbutler/ui_controller.rb +6 -2
- data/app/helpers/emailbutler/application_helper.rb +7 -0
- data/app/views/emailbutler/ui/index.html.erb +5 -3
- data/app/views/emailbutler/ui/show.html.erb +40 -31
- data/lib/emailbutler/version.rb +1 -1
- data/lib/emailbutler/webhooks/mappers/sendgrid.rb +2 -2
- data/lib/emailbutler/webhooks/receiver.rb +2 -2
- metadata +17 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 66b96f7ab9361587e0c960875903a0c85cece5ed19ed6891a2acac9027600735
|
4
|
+
data.tar.gz: 93d341ed01c2a44c50b84bcdcbce9bb174a6aae6f88e896ac4f8e2a298a9cb2b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c3b0c916fc98bde2ab88bc1b0a226288ab1bb5123faac70b121b6d025e22e6892bfc56d55bbffb96f0c9370b15be8b4f096f3d3c773b1afd4baa614aa687fc6
|
7
|
+
data.tar.gz: b844827b40c941522993c4993a4c0aa2ab75d789a703189ed1f47c92733166a34d1c16f9b93d7e599d3a699d88e82655024146d4f879c7f28ce880457d1f9986
|
data/README.md
CHANGED
@@ -42,6 +42,13 @@ Add this line to config/routes.rb
|
|
42
42
|
mount Emailbutler::Engine => '/emailbutler'
|
43
43
|
```
|
44
44
|
|
45
|
+
### UI styles
|
46
|
+
|
47
|
+
For adding styles for UI you need to add this line to assets/config/manifest.js
|
48
|
+
```js
|
49
|
+
//= link emailbutler.css
|
50
|
+
```
|
51
|
+
|
45
52
|
### Mailers
|
46
53
|
|
47
54
|
Update you application mailer
|
@@ -68,8 +75,12 @@ end
|
|
68
75
|
|
69
76
|
### UI
|
70
77
|
|
71
|
-
Emailbutler provides UI with rendering email tracking statistics - /emailbutler/ui.
|
72
|
-
|
78
|
+
Emailbutler provides UI with rendering email tracking statistics - /emailbutler/ui, with opportunity to search, resend and/or destroy emails.
|
79
|
+
|
80
|
+
<img width="1463" alt="ui_index" src="https://user-images.githubusercontent.com/6195394/202743189-19d1845d-7991-494f-93c1-0dd92b0b5dac.png">
|
81
|
+
|
82
|
+
<img width="1461" alt="ui_show" src="https://user-images.githubusercontent.com/6195394/202743225-b0ba0ca2-d373-428c-973d-5ec4566a3784.png">
|
83
|
+
|
73
84
|
|
74
85
|
## License
|
75
86
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
@@ -62,34 +62,52 @@
|
|
62
62
|
flex: 1;
|
63
63
|
height: 100%;
|
64
64
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
65
|
+
.pagination {
|
66
|
+
margin-bottom: 1rem;
|
67
|
+
|
68
|
+
.page {
|
69
|
+
padding: .25rem .5rem;
|
70
|
+
background: #bbf7d0;
|
71
|
+
color: #000;
|
72
|
+
|
73
|
+
a {
|
74
|
+
color: #000;
|
70
75
|
}
|
71
76
|
}
|
72
77
|
}
|
73
78
|
|
74
|
-
|
75
|
-
|
76
|
-
&:nth-of-type(odd) {
|
77
|
-
background: #e5e7eb;
|
78
|
-
}
|
79
|
+
table {
|
80
|
+
width: 100%;
|
79
81
|
|
80
|
-
|
81
|
-
|
82
|
+
thead {
|
83
|
+
tr {
|
84
|
+
th {
|
85
|
+
text-align: left;
|
86
|
+
padding: .125rem .25rem;
|
87
|
+
}
|
82
88
|
}
|
89
|
+
}
|
90
|
+
|
91
|
+
tbody {
|
92
|
+
tr {
|
93
|
+
&:nth-of-type(odd) {
|
94
|
+
background: #e5e7eb;
|
95
|
+
}
|
96
|
+
|
97
|
+
&:hover {
|
98
|
+
background: #d1d5db;
|
99
|
+
}
|
83
100
|
|
84
|
-
|
85
|
-
|
101
|
+
td {
|
102
|
+
padding: .125rem .25rem;
|
86
103
|
|
87
|
-
|
88
|
-
|
104
|
+
&.actions {
|
105
|
+
display: flex;
|
89
106
|
|
90
|
-
|
91
|
-
|
92
|
-
|
107
|
+
button {
|
108
|
+
&:nth-of-type(1) {
|
109
|
+
margin-right: .5rem;
|
110
|
+
}
|
93
111
|
}
|
94
112
|
}
|
95
113
|
}
|
@@ -1,7 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'pagy'
|
4
|
+
|
3
5
|
module Emailbutler
|
4
6
|
class UiController < Emailbutler::ApplicationController
|
7
|
+
include Pagy::Backend
|
8
|
+
|
5
9
|
http_basic_authenticate_with name: Emailbutler.configuration.ui_username,
|
6
10
|
password: Emailbutler.configuration.ui_password,
|
7
11
|
if: -> { basic_auth_enabled? }
|
@@ -11,14 +15,14 @@ module Emailbutler
|
|
11
15
|
end
|
12
16
|
|
13
17
|
def show
|
14
|
-
@messages = Emailbutler.find_messages_by(search_condition)
|
18
|
+
@pagy, @messages = pagy(Emailbutler.find_messages_by(search_condition))
|
15
19
|
end
|
16
20
|
|
17
21
|
private
|
18
22
|
|
19
23
|
def search_condition
|
20
24
|
{
|
21
|
-
status: params[:id],
|
25
|
+
status: params[:id] == 'all' ? nil : params[:id],
|
22
26
|
mailer: params[:mailer_name].presence,
|
23
27
|
action: params[:action_name].presence,
|
24
28
|
send_to: [params[:receiver].presence].compact.presence
|
@@ -1,8 +1,10 @@
|
|
1
1
|
<div id="dashboard">
|
2
2
|
<ul class="summary">
|
3
|
-
<li
|
4
|
-
|
5
|
-
|
3
|
+
<li>
|
4
|
+
<%= link_to ui_path(:all), class: 'status-summary' do %>
|
5
|
+
<span><%= @summary.values.sum %></span>
|
6
|
+
<span>Total</span>
|
7
|
+
<% end %>
|
6
8
|
</li>
|
7
9
|
<% Emailbutler.adapter.message_class.statuses.each_key do |status| %>
|
8
10
|
<li>
|
@@ -16,37 +16,46 @@
|
|
16
16
|
<%= form.submit 'Search', class: 'button' %>
|
17
17
|
<% end %>
|
18
18
|
</section>
|
19
|
-
<
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
<th>Mailer</th>
|
24
|
-
<th>Action</th>
|
25
|
-
<th>Send to</th>
|
26
|
-
<th>Action params</th>
|
27
|
-
<th>Mailer params</th>
|
28
|
-
<th></th>
|
29
|
-
</tr>
|
30
|
-
</thead>
|
31
|
-
<tbody>
|
32
|
-
<% @messages.each do |message| %>
|
19
|
+
<section class="messages">
|
20
|
+
<%== pagy_nav(@pagy) %>
|
21
|
+
<table cellspacing="0">
|
22
|
+
<thead>
|
33
23
|
<tr>
|
34
|
-
<
|
35
|
-
<
|
36
|
-
<
|
37
|
-
<
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
</
|
42
|
-
<
|
43
|
-
<
|
44
|
-
<td class="actions">
|
45
|
-
<%= button_to 'Resend', ui_message_path(message.uuid), method: :patch, class: 'button' %>
|
46
|
-
<%= button_to 'Destroy', ui_message_path(message.uuid), method: :delete, class: 'button warning' %>
|
47
|
-
</td>
|
24
|
+
<th>ID</th>
|
25
|
+
<th>Mailer</th>
|
26
|
+
<th>Action</th>
|
27
|
+
<th>Send to</th>
|
28
|
+
<% if params[:id] == 'all' %>
|
29
|
+
<th>Status</th>
|
30
|
+
<% end %>
|
31
|
+
<th>Action params</th>
|
32
|
+
<th>Mailer params</th>
|
33
|
+
<th></th>
|
48
34
|
</tr>
|
49
|
-
|
50
|
-
|
51
|
-
|
35
|
+
</thead>
|
36
|
+
<tbody>
|
37
|
+
<% @messages.each do |message| %>
|
38
|
+
<tr>
|
39
|
+
<td><%= message.id %></td>
|
40
|
+
<td><%= message.mailer %></td>
|
41
|
+
<td><%= message.action %></td>
|
42
|
+
<td>
|
43
|
+
<% message.send_to.each do |receiver| %>
|
44
|
+
<p><%= receiver %></p>
|
45
|
+
<% end %>
|
46
|
+
</td>
|
47
|
+
<% if params[:id] == 'all' %>
|
48
|
+
<td><%= message.status %></td>
|
49
|
+
<% end %>
|
50
|
+
<td><%= message.params['action_params'] %></td>
|
51
|
+
<td><%= message.params['mailer_params'] %></td>
|
52
|
+
<td class="actions">
|
53
|
+
<%= button_to 'Resend', ui_message_path(message.uuid), method: :patch, class: 'button' %>
|
54
|
+
<%= button_to 'Destroy', ui_message_path(message.uuid), method: :delete, class: 'button warning' %>
|
55
|
+
</td>
|
56
|
+
</tr>
|
57
|
+
<% end %>
|
58
|
+
</tbody>
|
59
|
+
</table>
|
60
|
+
</section>
|
52
61
|
</div>
|
data/lib/emailbutler/version.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: emailbutler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bogdanov Anton
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-11-
|
11
|
+
date: 2022-11-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: pagy
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '5.10'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '5.10'
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: rails
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -171,6 +185,7 @@ files:
|
|
171
185
|
- app/controllers/emailbutler/ui/messages_controller.rb
|
172
186
|
- app/controllers/emailbutler/ui_controller.rb
|
173
187
|
- app/controllers/emailbutler/webhooks_controller.rb
|
188
|
+
- app/helpers/emailbutler/application_helper.rb
|
174
189
|
- app/views/emailbutler/ui/index.html.erb
|
175
190
|
- app/views/emailbutler/ui/shared/_footer.html.erb
|
176
191
|
- app/views/emailbutler/ui/shared/_header.html.erb
|