base-api-io 1.4.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +5 -0
- data/lib/base/endpoints/emails.rb +12 -2
- data/lib/base/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 03115ed6815dd53c76ccfff2afa2bcce99b45af31b1f4828b5e9852eee241fff
|
4
|
+
data.tar.gz: 86aafc849d1c51cb8bd316b8d2bcc8c33b8ede7f4a1566984bde0a92ce6c408f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c93d0faa0134a7cdc46bab8c8b77a7ab839bced97d2ef0cd3d571d98c5a290770b351bebbf3e7f969463ce7744c50b83511c68da56ef473cc68f4e75fe2b68c
|
7
|
+
data.tar.gz: 2cbf6000c0b364a0eecc5ed1c843eb3ad2743a103ae4d26dafe59ca1174868c8f32016a806698c5f3afc57228f2ddc9535c1601a5e99a9e14a70a812f440ae18
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -44,6 +44,11 @@ Just run this command: `gem install base-api-io`
|
|
44
44
|
Using the `emails` endpoint on the client you can send emails:
|
45
45
|
|
46
46
|
```ruby
|
47
|
+
# List emails
|
48
|
+
emails = client.emails.list(page: 1, per_page: 10)
|
49
|
+
emails.items # The array of emails
|
50
|
+
emails.metadata # The metadata object containing the total count
|
51
|
+
|
47
52
|
# Sending an email
|
48
53
|
email =
|
49
54
|
client.emails.send(
|
@@ -6,10 +6,20 @@ module Base
|
|
6
6
|
class Emails < Endpoint
|
7
7
|
# Initializes this endpoint.
|
8
8
|
def initialize(access_token:, url:)
|
9
|
-
@path = '
|
9
|
+
@path = 'emails'
|
10
10
|
super
|
11
11
|
end
|
12
12
|
|
13
|
+
# Lists the emails of a project
|
14
|
+
def list(page: 1, per_page: 10)
|
15
|
+
request do
|
16
|
+
response =
|
17
|
+
connection.get('', per_page: per_page, page: page)
|
18
|
+
|
19
|
+
parse(response.body)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
13
23
|
# Sends an email with the given parameters.
|
14
24
|
#
|
15
25
|
# If there is no sending domain set up all emails will use the
|
@@ -18,7 +28,7 @@ module Base
|
|
18
28
|
#
|
19
29
|
# If there is a sending domain, the sender must match that domain
|
20
30
|
# otherwise it will return an error.
|
21
|
-
def send(subject:, from:,
|
31
|
+
def send(subject:, from:, to:, html: nil, text: nil)
|
22
32
|
request do
|
23
33
|
response =
|
24
34
|
connection.post('',
|
data/lib/base/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: base-api-io
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gusztáv Szikszai
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-10-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|