mailosaur 7.3.2 → 7.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/Mailosaur/messages.rb +56 -0
- data/lib/Mailosaur/models/message_create_options.rb +31 -0
- data/lib/Mailosaur/models/message_forward_options.rb +23 -0
- data/lib/Mailosaur/models/message_reply_options.rb +18 -0
- data/lib/Mailosaur/version.rb +1 -1
- data/lib/mailosaur.rb +3 -0
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0629407acde130c71828a35283ecc427f73881193164f236a970d6226fe4ed7d'
|
4
|
+
data.tar.gz: 66d6af0d7d7bd39d52f61c87c80acbf4524e2324c5ffe0c264397d8c99e4cdd0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1754ac94d3a1566bf813e9adc6012ca42fa7be204dab7d733a2ae8bcc8d14b44a947f18a2795212ad49fd09406ebc3ba93c4cbc77b0ef57ecbf8c4f303cf4ea1
|
7
|
+
data.tar.gz: 511648f014115e7ab22f8cf2893ff87264a7355b8dddf193655c992b742ff48a30cc69d57f8ca44589e45e246fb6566cb17a503714fc9c30c013e712127a0817
|
data/lib/Mailosaur/messages.rb
CHANGED
@@ -170,5 +170,61 @@ module Mailosaur
|
|
170
170
|
sleep(delay / 1000)
|
171
171
|
end
|
172
172
|
end
|
173
|
+
|
174
|
+
#
|
175
|
+
# Create a message.
|
176
|
+
#
|
177
|
+
# Creates a new message that can be sent to a verified email address. This is
|
178
|
+
# useful in scenarios where you want an email to trigger a workflow in your
|
179
|
+
# product
|
180
|
+
#
|
181
|
+
# @param server [String] The identifier of the server to create the message in.
|
182
|
+
# @param options [MessageCreateOptions] The options with which to create the message.
|
183
|
+
#
|
184
|
+
# @return [Message] operation result.
|
185
|
+
#
|
186
|
+
def create(server, message_create_options)
|
187
|
+
response = conn.post 'api/messages?server=' + server, message_create_options.to_json
|
188
|
+
@handle_http_error.call(response) unless response.status == 200
|
189
|
+
model = JSON.load(response.body)
|
190
|
+
Mailosaur::Models::Message.new(model)
|
191
|
+
end
|
192
|
+
|
193
|
+
#
|
194
|
+
# Forward an email.
|
195
|
+
#
|
196
|
+
# Forwards the specified email to a verified email address.
|
197
|
+
#
|
198
|
+
# @param id [String] The identifier of the email to forward.
|
199
|
+
# @param options [MessageForwardOptions] The options with which to forward the email.
|
200
|
+
# against.
|
201
|
+
#
|
202
|
+
# @return [Message] operation result.
|
203
|
+
#
|
204
|
+
def forward(id, message_forward_options)
|
205
|
+
response = conn.post 'api/messages/' + id + '/forward', message_forward_options.to_json
|
206
|
+
@handle_http_error.call(response) unless response.status == 200
|
207
|
+
model = JSON.load(response.body)
|
208
|
+
Mailosaur::Models::Message.new(model)
|
209
|
+
end
|
210
|
+
|
211
|
+
#
|
212
|
+
# Reply to an email.
|
213
|
+
#
|
214
|
+
# Sends a reply to the specified email. This is useful for when simulating a user
|
215
|
+
# replying to one of your emails.
|
216
|
+
#
|
217
|
+
# @param id [String] The identifier of the email to reply to.
|
218
|
+
# @param options [MessageReplyOptions] The options with which to reply to the email.
|
219
|
+
# against.
|
220
|
+
#
|
221
|
+
# @return [Message] operation result.
|
222
|
+
#
|
223
|
+
def reply(id, message_reply_options)
|
224
|
+
response = conn.post 'api/messages/' + id + '/reply', message_reply_options.to_json
|
225
|
+
@handle_http_error.call(response) unless response.status == 200
|
226
|
+
model = JSON.load(response.body)
|
227
|
+
Mailosaur::Models::Message.new(model)
|
228
|
+
end
|
173
229
|
end
|
174
230
|
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module Mailosaur
|
2
|
+
module Models
|
3
|
+
class MessageCreateOptions < BaseModel
|
4
|
+
def initialize(data = {})
|
5
|
+
@to = data['to']
|
6
|
+
@send = data['send']
|
7
|
+
@subject = data['subject']
|
8
|
+
@text = data['text']
|
9
|
+
@html = data['html']
|
10
|
+
end
|
11
|
+
|
12
|
+
# @return [String] The email address to which the email will be sent.
|
13
|
+
# Must be a verified email address.
|
14
|
+
attr_accessor :to
|
15
|
+
|
16
|
+
# @return [Boolean] If true, email will be sent upon creation.
|
17
|
+
attr_accessor :send
|
18
|
+
|
19
|
+
# @return [String] The email subject line.
|
20
|
+
attr_accessor :subject
|
21
|
+
|
22
|
+
# @return [String] The plain text body of the email. Note that only
|
23
|
+
# text or html can be supplied, not both.
|
24
|
+
attr_accessor :text
|
25
|
+
|
26
|
+
# @return [String] The HTML body of the email. Note that only text
|
27
|
+
# or html can be supplied, not both.
|
28
|
+
attr_accessor :html
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module Mailosaur
|
2
|
+
module Models
|
3
|
+
class MessageForwardOptions < BaseModel
|
4
|
+
def initialize(data = {})
|
5
|
+
@to = data['to']
|
6
|
+
@text = data['text']
|
7
|
+
@html = data['html']
|
8
|
+
end
|
9
|
+
|
10
|
+
# @return [String] The email address to which the email will be sent.
|
11
|
+
# Must be a verified email address.
|
12
|
+
attr_accessor :to
|
13
|
+
|
14
|
+
# @return [String] Any additional plain text content to forward the
|
15
|
+
# email with. Note that only text or html can be supplied, not both.
|
16
|
+
attr_accessor :text
|
17
|
+
|
18
|
+
# @return [String] Any additional HTML content to forward the email
|
19
|
+
# with. Note that only html or text can be supplied, not both.
|
20
|
+
attr_accessor :html
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module Mailosaur
|
2
|
+
module Models
|
3
|
+
class MessageReplyOptions < BaseModel
|
4
|
+
def initialize(data = {})
|
5
|
+
@text = data['text']
|
6
|
+
@html = data['html']
|
7
|
+
end
|
8
|
+
|
9
|
+
# @return [String] Any additional plain text content to include in
|
10
|
+
# the reply. Note that only text or html can be supplied, not both.
|
11
|
+
attr_accessor :text
|
12
|
+
|
13
|
+
# @return [String] Any additional HTML content to include in the
|
14
|
+
# reply. Note that only html or text can be supplied, not both.
|
15
|
+
attr_accessor :html
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
data/lib/Mailosaur/version.rb
CHANGED
data/lib/mailosaur.rb
CHANGED
@@ -26,6 +26,9 @@ module Mailosaur
|
|
26
26
|
autoload :MessageSummary, 'Mailosaur/models/message_summary.rb'
|
27
27
|
autoload :Image, 'Mailosaur/models/image.rb'
|
28
28
|
autoload :MessageListResult, 'Mailosaur/models/message_list_result.rb'
|
29
|
+
autoload :MessageCreateOptions, 'Mailosaur/models/message_create_options.rb'
|
30
|
+
autoload :MessageForwardOptions, 'Mailosaur/models/message_forward_options.rb'
|
31
|
+
autoload :MessageReplyOptions, 'Mailosaur/models/message_reply_options.rb'
|
29
32
|
autoload :Attachment, 'Mailosaur/models/attachment.rb'
|
30
33
|
autoload :SearchCriteria, 'Mailosaur/models/search_criteria.rb'
|
31
34
|
autoload :MessageContent, 'Mailosaur/models/message_content.rb'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mailosaur
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.
|
4
|
+
version: 7.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mailosaur
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-10-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -164,8 +164,11 @@ files:
|
|
164
164
|
- lib/Mailosaur/models/message.rb
|
165
165
|
- lib/Mailosaur/models/message_address.rb
|
166
166
|
- lib/Mailosaur/models/message_content.rb
|
167
|
+
- lib/Mailosaur/models/message_create_options.rb
|
168
|
+
- lib/Mailosaur/models/message_forward_options.rb
|
167
169
|
- lib/Mailosaur/models/message_header.rb
|
168
170
|
- lib/Mailosaur/models/message_list_result.rb
|
171
|
+
- lib/Mailosaur/models/message_reply_options.rb
|
169
172
|
- lib/Mailosaur/models/message_summary.rb
|
170
173
|
- lib/Mailosaur/models/metadata.rb
|
171
174
|
- lib/Mailosaur/models/search_criteria.rb
|