emailbutler 0.8.1 → 0.8.2

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: e06b545b530403687a7844d31538ea50de73cffbc8f225ab5a849fe13d7678b0
4
- data.tar.gz: c6fdc2b0fcf1afb430c0b1c80b2b1b89f9273007a54f97b3c96ddbad44a1bef2
3
+ metadata.gz: 8e223a593bef4c9075afed0fa29d31057519250a0949a589c8535232d632bc83
4
+ data.tar.gz: 7355cdbd47a964b9da80cbf0a80203c40865ebc5cec0af272595d105a4cbcb16
5
5
  SHA512:
6
- metadata.gz: 71919a2533d61eb98ea21ef74266c261f1569acaf8ae2193fa30eef083b2ae06c659ec38af299d86d67d5b09f06ed9391b7fd63ba143687bd2592d071bbac916
7
- data.tar.gz: ea46055aa238b71c0c237138caf69e2ed8b4580d0956e95274e3762071b7ae72e273ddf6fc43147634d0723d8b5966b31b8a25d89b8ed71901937fa7c1f9e12a
6
+ metadata.gz: 0d92a36b9c851110c9c038f7ef077119cde85fed6f1731531db011649cbbe83fa8d2d1ab1db310a5e8df513014277fb074a9445088ff195d5f649ac7d385a97a
7
+ data.tar.gz: 5313f1e26f096577cbc2ad07be23842862ebf9a24b1ccc358a51469130bce50e416b9ffe5e6895b3e14962e43a1f389b271daeca0a0cdedd0516564d270ef632
@@ -2,22 +2,9 @@
2
2
 
3
3
  module Emailbutler
4
4
  class WebhooksController < Emailbutler::ApplicationController
5
- # deprecated constants
6
- SENDGRID_USER_AGENT = 'SendGrid Event API'
7
- SMTP2GO_USER_AGENT = 'Go-http-client/1.1'
8
-
9
5
  skip_before_action :verify_authenticity_token
10
6
  before_action :validate_provider, only: %i[create]
11
7
 
12
- def create_deprecated
13
- Emailbutler::Container.resolve(:webhooks_receiver).call(
14
- mapper: receiver_mapper_deprecated(request.headers['HTTP_USER_AGENT']),
15
- payload: mapper_params_deprecated.to_h
16
- )
17
-
18
- head :ok
19
- end
20
-
21
8
  def create
22
9
  Emailbutler::Container.resolve(:webhooks_receiver).call(
23
10
  mapper: receiver_mapper,
@@ -60,19 +47,5 @@ module Emailbutler
60
47
  def resend_params
61
48
  params.permit('type', 'created_at', 'data' => %w[email_id])
62
49
  end
63
-
64
- def receiver_mapper_deprecated(user_agent)
65
- case user_agent
66
- when SENDGRID_USER_AGENT then Emailbutler::Container.resolve(:sendgrid_mapper)
67
- when SMTP2GO_USER_AGENT then Emailbutler::Container.resolve(:smtp2go_mapper)
68
- end
69
- end
70
-
71
- def mapper_params_deprecated
72
- params.permit(
73
- 'event', 'sendtime', 'message-id',
74
- '_json' => %w[event timestamp smtp-id sg_message_id]
75
- )
76
- end
77
50
  end
78
51
  end
data/config/routes.rb CHANGED
@@ -1,8 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  Emailbutler::Engine.routes.draw do
4
- post '/webhooks', to: 'webhooks#create_deprecated'
5
- post '/webhooks/:provider', to: 'webhooks#create'
4
+ post '/webhooks/:provider', to: 'webhooks#create' if Emailbutler.configuration.providers.any?
6
5
 
7
6
  resources :ui, only: %i[index show]
8
7
  namespace :ui do
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Emailbutler
4
- VERSION = '0.8.1'
4
+ VERSION = '0.8.2'
5
5
  end
data/lib/emailbutler.rb CHANGED
@@ -24,12 +24,6 @@ module Emailbutler
24
24
  # end
25
25
  #
26
26
  def configure
27
- ActiveSupport::Deprecation.new.warn(
28
- 'Webhook endpoint should receive provider name in params. ' \
29
- 'Please update webhook url in settings of your SMTP provider.' \
30
- 'Webhook without provider in params will be removed soon.'
31
- )
32
-
33
27
  yield configuration
34
28
 
35
29
  configuration.validate
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.8.1
4
+ version: 0.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bogdanov Anton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-06-04 00:00:00.000000000 Z
11
+ date: 2024-06-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-container