snails 0.5.2 → 0.5.3

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: c51be73d14310ba453942f9efe4e69abc9070ee397ff88b087c6bd87d6d5f735
4
- data.tar.gz: eaf3bef1b643740b0cbcc157948296ee6d75ff49dc9afbf19757a555edaefe4a
3
+ metadata.gz: b2141ab903141a92598342792b0899b2edbc2a34f5bb0b99e15fe29cfcba39b0
4
+ data.tar.gz: 4ba7c23a174c9dd87ca088e0c3a9bb3394aaf83798a8ea00bb54fbf323a00b96
5
5
  SHA512:
6
- metadata.gz: a5b24fc18bc44811bb4106c8e1e9704f8e503c208d92fd654a8413254cdd3a8c811f0e7d008df9543d5ee4b8715d8f422aff55b56f5c9db2266240498a2adf28
7
- data.tar.gz: e4d349508b3543199d187fda1a2a4a85efbd65a500ec9a2110dd48c6a9d7a57380dabe1143ffeaac6ef9aa397c491f3abb48cb217b554921e988fd9cc634ab7a
6
+ metadata.gz: 82448a3d03af7f7ebf4d8a40a95c4b95c193e0cfa4f93787eb3da22fbe21e6fdeaece97673037a44d2d47ff36b8962cfde325ec943461bf85c98b5444749ea30
7
+ data.tar.gz: 21b7792db470ed2967b7961593777873af3d5b50dcc23b3ba30d37d075354c42f4c9377bea8a416c13c00a2099eab60ab2e05cbb5693e199227ed05b88f493e8
data/lib/snails/app.rb CHANGED
@@ -414,7 +414,7 @@ module Snails
414
414
 
415
415
  set :protection, except: :frame_options
416
416
  set :views, Snails.root.join('lib', 'views')
417
- set :static_paths, %w(/css /img /js /files /fonts favicon.ico)
417
+ set :static_paths, %w(/css /img /js /files /fonts /favicon.ico)
418
418
 
419
419
  enable :method_override
420
420
  enable :logging
data/lib/snails/mailer.rb CHANGED
@@ -187,7 +187,7 @@ A <%= @exception.class %> occurred in <%= @url %>:
187
187
  resp, email = Tuktuk.deliver(email, debug: debug)
188
188
 
189
189
  if resp.is_a?(Tuktuk::Bounce)
190
- puts "[#{to}] Email bounced! [#{resp.code}] #{resp.message}"
190
+ puts "[#{email[:to]}] Email bounced! [#{resp.code}] #{resp.message}"
191
191
  end
192
192
 
193
193
  return resp, email
@@ -201,8 +201,8 @@ A <%= @exception.class %> occurred in <%= @url %>:
201
201
  class MailgunBackend < Backend
202
202
 
203
203
  def initialize(api_key:, domain_name:)
204
- @key = api_key
205
- @url = "https://api.mailgun.net/v3/#{domain_name}/messages"
204
+ # @key = api_key
205
+ @url = "https://api:#{api_key}@api.mailgun.net/v3/#{domain_name}/messages"
206
206
  end
207
207
 
208
208
  def deliver(email, options = {})
@@ -221,9 +221,12 @@ A <%= @exception.class %> occurred in <%= @url %>:
221
221
  raise ArgumentError, "Either text or html required"
222
222
  end
223
223
 
224
- opts = { username: 'api', password: @key }
225
- resp = Dagger.post(@url, data, opts)
226
- resp.ok? ? [resp.data, data[:to]] : nil
224
+ if email[:attachments]
225
+ data[:attachment] = email[:attachments].map { |att| { att[:content] }
226
+ end
227
+
228
+ resp = RestClient.post(@url, data)
229
+ resp.code == 200 ? [resp.body, data[:to]] : nil
227
230
  end
228
231
 
229
232
  end
data/snails.gemspec CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "snails"
6
- s.version = '0.5.2'
6
+ s.version = '0.5.3'
7
7
  s.platform = Gem::Platform::RUBY
8
8
  s.authors = ['Tomás Pollak']
9
9
  s.email = ['tomas@forkhq.com']
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: snails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomás Pollak