emailfuse 0.1.2 → 0.1.4

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: 9cbf4602cc744b6975dae3b8270edcf971935bb89d754d26d001f759ce22cf50
4
- data.tar.gz: 6afb324f38ccef286802240b61e0b4bfc474a113fddcfafbdd2fda6852162119
3
+ metadata.gz: 1870b9111d8d731962de39300f68e6ac57faa8a67e4233d70eda08e32848d675
4
+ data.tar.gz: c0b955ed9bff041c6410d9b5ab93ba1a7292d3377630a1080a416cfb3d4d57cf
5
5
  SHA512:
6
- metadata.gz: c63d05761c93746539005398cc1708a2206f9998d858ed8aef62b7d914bbfdb657960087c315f92fb3abdb96018d1ae5294ce40c199c81aaf6350d31d63feddd
7
- data.tar.gz: 89a27c562f6195577b7942782462ff2fd294ff830e064714f6387c056a3e54ac3920b41fc5834f816b95cdbcffdba672b92466ed6fbe341eab3f750eb9323e05
6
+ metadata.gz: d60b56c812cb1198f619442d9bc1758205d458734f6f3e163d385558ca12c6b294367a828189d807571e7699a60cd9a458c2afd529c7fd4c0ffec4021108c378
7
+ data.tar.gz: 78a748fffc10dcd1bf3959b0da4a6649e241a71b14ec6579f9d7376e261e547f67d9cfdafd9938a6f81927dde7c47e2d470043e36811b2630c6506ba4fbaa171
@@ -2,11 +2,11 @@ module Emailfuse
2
2
  class Client
3
3
  class << self
4
4
  def url
5
- Emailfuse.config.host || "https://api.emailfuse.net"
5
+ Emailfuse.config.host || "https://app.emailfuse.net"
6
6
  end
7
7
 
8
8
  def connection
9
- @connection ||= Faraday.new("#{url}/v1") do |conn|
9
+ @connection ||= Faraday.new("#{url}/api/v1") do |conn|
10
10
  conn.request :authorization, :Bearer, Emailfuse.config.token
11
11
 
12
12
  conn.headers = {
@@ -24,12 +24,16 @@ module Emailfuse
24
24
  def deliver!(rails_message)
25
25
  attributes = {
26
26
  from: rails_message[:from],
27
- to: rails_message[:to],
27
+ to: rails_message[:to].formatted,
28
28
  subject: rails_message.subject,
29
29
  html: extract_html(rails_message),
30
30
  text: extract_text(rails_message)
31
31
  }
32
32
 
33
+ [ :reply_to, :cc ].each do |key|
34
+ attributes[key] = rails_message[key].formatted if rails_message[key]
35
+ end
36
+
33
37
  unless rails_message.attachments.empty?
34
38
  attributes[:attachments] = []
35
39
  rails_message.attachments.each do |attachment|
@@ -4,7 +4,7 @@ module Emailfuse
4
4
  def create(to:, from:, subject:, html: nil, text: nil, **attributes)
5
5
  raise ArgumentError, "You must provide either html or text" if html.nil? && text.nil?
6
6
 
7
- attributes.merge!(
7
+ attrs = attributes.merge!(
8
8
  to: to,
9
9
  from: from,
10
10
  subject: subject,
@@ -12,7 +12,7 @@ module Emailfuse
12
12
  text: text
13
13
  )
14
14
 
15
- response = Client.post_request("emails", body: attributes)
15
+ response = Client.post_request("emails", body: attrs)
16
16
 
17
17
  Email.new(response.body) if response.success?
18
18
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Emailfuse
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.4"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: emailfuse
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dean Perry
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-06-14 00:00:00.000000000 Z
11
+ date: 2024-09-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionmailer
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '7.0'
19
+ version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '7.0'
26
+ version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: faraday
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -90,7 +90,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
90
90
  - !ruby/object:Gem::Version
91
91
  version: '0'
92
92
  requirements: []
93
- rubygems_version: 3.5.9
93
+ rubygems_version: 3.5.11
94
94
  signing_key:
95
95
  specification_version: 4
96
96
  summary: Ruby library for the Emailfuse API including an Rails Action Mailer adapter