emailbutler 0.6.0 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 96c47554b3dff802186e976ac920a6eed359a1456ae92f8ee2b83c69d2b40888
4
- data.tar.gz: 2535b2f6382d82ce758ef66d284464fa3d4efb3ad25ff8cbe6aa6149239f9216
3
+ metadata.gz: 70bf205c00cb4bf8907b43c549d763cee107e138e61bca507c130677726d7d86
4
+ data.tar.gz: 9bd2eeb375ef2d02e0dff933586ac46093be662bafd3aa767a3441963678c6f7
5
5
  SHA512:
6
- metadata.gz: 9005a677eae021cffbd41b445a16f94b456fbdcff225817d926c956e77936972360197acf158146c44a4e1f8b9f75aa510c42278f4e3af4fb26b9ed1d173ffa4
7
- data.tar.gz: 5b6744301569fd37cb366bb06f571f741c8316eb42df73a9576ff9827cd90cbf599e2b17f28a9b51ac4ad53c900d47a600e076f7712d3dfbd9c648dc4361eb0d
6
+ metadata.gz: 7a694d31890e57a695aaf380c664a25a2cac922b3b89d6dc196e19a07b3119fb62eb72501999da5c2e2fd48365c43e8b26718d38907f5fa68394b83df53faee9
7
+ data.tar.gz: 9100a4c42424bc8a6a1c1b1ef899dd3f02fef8f4c88592c958e1da0fb52e16d545e66ef0bc081551b62fe77c8a9f647bd3876036877cdf3e38ca0f68735c8a6f
data/README.md CHANGED
@@ -2,6 +2,10 @@
2
2
  Simple email tracker for Ruby on Rails applications.
3
3
  Emailbutler allows you to track delivery status of emails sent by your app.
4
4
 
5
+ There are situations when you need to check whether a certain letter or certain type of letters was successfully sent from the application, and through the UI of some providers you can try to find such a letter by the recipient or the subject of the letter, but sometimes it's not enough.
6
+
7
+ Emailbutler allows you to monitor the sending of letters, collects notifications from providers about the success of delivery and adds an UI for monitoring deliveries with filtering by recipients, mailers and actions.
8
+
5
9
  ## Installation
6
10
 
7
11
  Add this line to your application's Gemfile:
@@ -42,6 +46,34 @@ Add this line to config/routes.rb
42
46
  mount Emailbutler::Engine => '/emailbutler'
43
47
  ```
44
48
 
49
+ #### Custom routes
50
+
51
+ If you need some custom behaviour you can specify your own route and use custom controller, something like
52
+
53
+ ```ruby
54
+ class SendgridController < ApplicationController
55
+ skip_before_action :basic_authentication
56
+ skip_before_action :verify_authenticity_token
57
+
58
+ def create
59
+ ... you can add some logic here
60
+
61
+ ::Emailbutler::Webhooks::Receiver.call(
62
+ user_agent: ::Emailbutler::Webhooks::Receiver::SENDGRID_USER_AGENT,
63
+ payload: receiver_params.to_h
64
+ )
65
+
66
+ head :ok
67
+ end
68
+
69
+ private
70
+
71
+ def receiver_params
72
+ params.permit('_json' => %w[smtp-id event timestamp sg_message_id])
73
+ end
74
+ end
75
+ ```
76
+
45
77
  ### UI styles
46
78
 
47
79
  For adding styles for UI you need to add this line to assets/config/manifest.js
@@ -49,6 +81,12 @@ For adding styles for UI you need to add this line to assets/config/manifest.js
49
81
  //= link emailbutler.css
50
82
  ```
51
83
 
84
+ Or in some cases you can specify it in assets/javascript/application.js
85
+
86
+ ```js
87
+ //= require emailbutler_manifest
88
+ ````
89
+
52
90
  ### Mailers
53
91
 
54
92
  Update you application mailer
@@ -81,6 +119,5 @@ Emailbutler provides UI with rendering email tracking statistics - /emailbutler/
81
119
 
82
120
  <img width="1461" alt="ui_show" src="https://user-images.githubusercontent.com/6195394/202743225-b0ba0ca2-d373-428c-973d-5ec4566a3784.png">
83
121
 
84
-
85
122
  ## License
86
123
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -6,19 +6,19 @@ module Emailbutler
6
6
  before_action :find_message
7
7
 
8
8
  def update
9
- Emailbutler.resend_message(@message)
9
+ ::Emailbutler.resend_message(@message)
10
10
  redirect_to ui_index_path
11
11
  end
12
12
 
13
13
  def destroy
14
- Emailbutler.destroy_message(@message)
14
+ ::Emailbutler.destroy_message(@message)
15
15
  redirect_to ui_index_path
16
16
  end
17
17
 
18
18
  private
19
19
 
20
20
  def find_message
21
- @message = Emailbutler.find_message_by(uuid: params[:id])
21
+ @message = ::Emailbutler.find_message_by(uuid: params[:id])
22
22
  end
23
23
  end
24
24
  end
@@ -4,18 +4,18 @@ require 'pagy'
4
4
 
5
5
  module Emailbutler
6
6
  class UiController < Emailbutler::ApplicationController
7
- include Pagy::Backend
7
+ include ::Pagy::Backend
8
8
 
9
- http_basic_authenticate_with name: Emailbutler.configuration.ui_username,
10
- password: Emailbutler.configuration.ui_password,
9
+ http_basic_authenticate_with name: ::Emailbutler.configuration.ui_username,
10
+ password: ::Emailbutler.configuration.ui_password,
11
11
  if: -> { basic_auth_enabled? }
12
12
 
13
13
  def index
14
- @summary = Emailbutler.count_messages_by_status
14
+ @summary = ::Emailbutler.count_messages_by_status
15
15
  end
16
16
 
17
17
  def show
18
- @pagy, @messages = pagy(Emailbutler.find_messages_by(search_condition))
18
+ @pagy, @messages = pagy(::Emailbutler.find_messages_by(search_condition))
19
19
  end
20
20
 
21
21
  private
@@ -30,7 +30,7 @@ module Emailbutler
30
30
  end
31
31
 
32
32
  def basic_auth_enabled?
33
- configuration = Emailbutler.configuration
33
+ configuration = ::Emailbutler.configuration
34
34
 
35
35
  return false if configuration.ui_username.blank?
36
36
  return false if configuration.ui_password.blank?
@@ -16,7 +16,7 @@ module Emailbutler
16
16
  private
17
17
 
18
18
  def receiver_params
19
- params.permit('_json' => %w[smtp-id event timestamp])
19
+ params.permit('_json' => %w[smtp-id event timestamp sg_message_id])
20
20
  end
21
21
  end
22
22
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Emailbutler
4
4
  module ApplicationHelper
5
- include Pagy::Frontend
5
+ include ::Pagy::Frontend
6
6
  end
7
7
  end
@@ -6,7 +6,7 @@
6
6
  <span>Total</span>
7
7
  <% end %>
8
8
  </li>
9
- <% Emailbutler.adapter.message_class.statuses.each_key do |status| %>
9
+ <% ::Emailbutler.adapter.message_class.statuses.each_key do |status| %>
10
10
  <li>
11
11
  <%= link_to ui_path(status), class: 'status-summary' do %>
12
12
  <span><%= @summary[status].to_i %></span>
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Emailbutler
4
- VERSION = '0.6.0'
4
+ VERSION = '0.6.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: emailbutler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bogdanov Anton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-19 00:00:00.000000000 Z
11
+ date: 2023-07-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pagy