mailersend-ruby 1.5.0 → 1.5.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: 119a856edc8f4a572776df083628ac9e91b03ad7d84c010d000f659dea7c5d02
4
- data.tar.gz: e8c4db7ef5ee7753acdeef7fb2e6696c215b614dc0c84c4c78b1e8dbeeb4b069
3
+ metadata.gz: 6346fa18c1ea9c31c279efee9ad04e00ea9aefbf9404cb809e7b4d03a4a68b39
4
+ data.tar.gz: ba5a053236908bcf7ddef6d96361637d7939dd0cbeff5064ce6ec99a080b3135
5
5
  SHA512:
6
- metadata.gz: ce60ac31b7af6e94b5b1ea51b9d7f4e0fa16b56bc870576b4ed49df45f93f032e6bcf68870d591ee84518dc248918086c5723e9bcf23b9b039d69276ebf6cbd5
7
- data.tar.gz: da94cb3b0fa6c9e92037401bb0d0adf6e70a84d9a066266bdcdef0bc038d9c01eb8db42280fac757853bb9e50d55942cc23c159dab358d6c5df1acb5db29f906
6
+ metadata.gz: aca1d6309de48cd46627023d6d17382349ace946b28d1b01b934b5d1806259c2ab0992ceaee4483b09fe6da70c601ef8b08683b7a0d066a2298eae7a0ef03e70
7
+ data.tar.gz: fe44c8e8a2563eaf6864c18284c8714feb68677c2fe666b6d1c03ed8a7a00441afab6a01301532fb184487661d15783e7d87ae0757f14be6eb80f4bdc3a1a712
@@ -8,7 +8,7 @@ jobs:
8
8
  steps:
9
9
  - uses: actions/checkout@v3
10
10
  - name: Set up Ruby
11
- uses: ruby/setup-ruby@v1.148.0
11
+ uses: ruby/setup-ruby@v1
12
12
  with:
13
13
  ruby-version: 3.0
14
14
  bundler-cache: true
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Released]
2
2
 
3
+ ## [1.5.1] - 2023-05-09
4
+
5
+ - Added supports for base64 attachment
6
+
3
7
  ## [1.5.0] - 2023-05-08
4
8
 
5
9
  - API Quota
data/Gemfile CHANGED
@@ -2,3 +2,9 @@
2
2
 
3
3
  source 'https://rubygems.org'
4
4
  gemspec
5
+
6
+ group :development do
7
+ gem 'bundler', '~> 2.4.10'
8
+ gem 'rake', '~> 13.0.6'
9
+ gem 'rubocop', '~> 1.52.1'
10
+ end
@@ -87,13 +87,19 @@ module Mailersend
87
87
  end
88
88
 
89
89
  def add_attachment(content:, filename:, disposition:)
90
- data = File.read(content.to_s)
91
- encoded = Base64.strict_encode64(data)
92
- @attachments << {
93
- 'content' => encoded,
94
- 'filename' => filename,
95
- 'disposition' => disposition
96
- }
90
+ # content: Can be one of the following:
91
+ # file_path(String) i.e. 'app/Sample-jpg-image-50kb.jpeg'
92
+ # Base64 encoded string (String)
93
+ # Supported types are: https://developers.mailersend.com/api/v1/email.html#supported-file-types
94
+
95
+ content_string = content.to_s
96
+ if File.readable?(content_string)
97
+ data = File.read(content_string)
98
+ base64_encoded = Base64.strict_encode64(data)
99
+ else
100
+ base64_encoded = content_string
101
+ end
102
+ @attachments << { 'content' => base64_encoded, 'filename' => filename, 'disposition' => disposition }
97
103
  end
98
104
 
99
105
  def add_send_at(send_at)
@@ -25,7 +25,6 @@ module Mailersend
25
25
  }
26
26
  client.http.get(URI::HTTPS.build(host: API_BASE_HOST, path: '/v1/identities',
27
27
  query: URI.encode_www_form(hash.compact)))
28
- puts response
29
28
  end
30
29
 
31
30
  def single(identity_id:)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Mailersend
4
- VERSION = '1.5.0'
4
+ VERSION = '1.5.2'
5
5
  end
@@ -27,9 +27,6 @@ Gem::Specification.new do |spec|
27
27
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
28
28
  spec.require_paths = ['lib']
29
29
 
30
- spec.add_development_dependency 'bundler', '~> 2.4.1'
31
- spec.add_development_dependency 'rake', '~> 13.0'
32
- spec.add_development_dependency 'rubocop', '~> 1.7'
33
30
  spec.add_dependency 'dotenv', '~> 2.7'
34
31
  spec.add_dependency 'http', '~> 5.0'
35
32
  spec.add_dependency 'json', '~> 2.5'
metadata CHANGED
@@ -1,57 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mailersend-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nikola Milojević
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-09 00:00:00.000000000 Z
11
+ date: 2023-06-20 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: bundler
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: 2.4.1
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: 2.4.1
27
- - !ruby/object:Gem::Dependency
28
- name: rake
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: '13.0'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: '13.0'
41
- - !ruby/object:Gem::Dependency
42
- name: rubocop
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: '1.7'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: '1.7'
55
13
  - !ruby/object:Gem::Dependency
56
14
  name: dotenv
57
15
  requirement: !ruby/object:Gem::Requirement
@@ -169,7 +127,7 @@ metadata:
169
127
  source_code_uri: https://github.com/mailersend/mailersend-ruby
170
128
  changelog_uri: https://github.com/mailersend/mailersend-ruby/blob/main/CHANGELOG.md
171
129
  rubygems_mfa_required: 'true'
172
- post_install_message:
130
+ post_install_message:
173
131
  rdoc_options: []
174
132
  require_paths:
175
133
  - lib
@@ -185,7 +143,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
185
143
  version: '0'
186
144
  requirements: []
187
145
  rubygems_version: 3.4.10
188
- signing_key:
146
+ signing_key:
189
147
  specification_version: 4
190
148
  summary: MailerSend's official Ruby SDK
191
149
  test_files: []