maxemail_api 2.0.11 → 2.0.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/maxemail_api/triggered.rb +8 -10
  3. metadata +2 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 62ce3af0d5a834e12b83023cc5b15ebfbc8a2692feb1ecc92b403c3eda75e22a
4
- data.tar.gz: b71143959aae4517b4dd896ce00580c15b50e284c82bec98395c9aa26ca1b4ab
3
+ metadata.gz: 9c91c22d45527ca3dea6c50dfe73ed82a5dd058b388c1e66875e809b7ed91ced
4
+ data.tar.gz: 14563f3b286a9047c98bcd1504ea8d6ee6b82276c683e09e6752e121b0543642
5
5
  SHA512:
6
- metadata.gz: 2de2fa8ee63953e2c71f95471ab110268caf18cf1fc19230149c659f21012765f39101c5faed87f8b66a61b52ab96aa6650d9e60a8d3d47c6fc161efa1b21b79
7
- data.tar.gz: 90f14c289fb0ca9f20df1a319a72e1fee80d7eed00d35855d379e9e35e710af8e0c561ee1b11691b6ec575bed27bd3ba6efe85d6ce873d1e6668032929500a82
6
+ metadata.gz: df3f2db4b64fe6f5b4bbd346a3e0d2ef45d1f528cc1057490b44542f57da213915c56a5cc00e700a432179f566339d6ddc7adaa5b60841f2231dd7a9ac7c62a1
7
+ data.tar.gz: b58c4a9c5927540255b9e6f4e861236845171944c7c54c9b1469a748c1bbcb950b7b2ed6b693d69d285002aabec494efe3f49ff504a6e6ea02c525e99b7c4c05
@@ -16,13 +16,13 @@ module MaxemailApiTriggered
16
16
  folderId: folder_id,
17
17
  profileData: profile_data.to_json }, method: 'email_send').body)
18
18
  return MaxemailApiResponse.new(data: {}, success: true, message: 'Mail sent') if response['success'] == true
19
- return MaxemailApiResponse.new(data: {}, success: false, message: 'Server error') if response['success'] == false
19
+ return MaxemailApiResponse.new(data: {}, success: false, message: response['msg']) if response['success'] == false
20
20
  rescue StandardError => e
21
21
  puts 'MaxemailApiResponse Error:'
22
22
  puts e
23
23
  puts "profile_data: #{profile_data}"
24
24
  puts 'END MaxemailApiResponse Error:'
25
- MaxemailApiResponse.new(data: {}, success: false, message: 'Server error')
25
+ MaxemailApiResponse.new(data: {}, success: false, message: response['msg']) if response.present?
26
26
  end
27
27
 
28
28
  def send_triggered(email_address: nil, email_id: nil, profile_data: nil)
@@ -35,12 +35,12 @@ module MaxemailApiTriggered
35
35
  profileData: profile_data.to_json }, method: 'email_send').body)
36
36
 
37
37
  return MaxemailApiResponse.new(data: {}, success: true, message: 'Mail sent') if response['success'] == true
38
- return MaxemailApiResponse.new(data: {}, success: false, message: 'Server error') if response['success'] == false
38
+ return MaxemailApiResponse.new(data: {}, success: false, message: response['msg']) if response['success'] == false
39
39
  rescue StandardError => e
40
40
  puts 'MaxemailApiResponse Error:'
41
41
  puts e
42
42
  puts 'END MaxemailApiResponse Error:'
43
- return MaxemailApiResponse.new(data: {}, success: false, message: 'Server error') if response['success'] == false
43
+ return MaxemailApiResponse.new(data: {}, success: false, message: response['msg']) if response.present?
44
44
  end
45
45
 
46
46
  def find_email_id(folder_name: nil, email_name: nil)
@@ -80,16 +80,14 @@ module MaxemailApiTriggered
80
80
  nil
81
81
  end
82
82
 
83
- def valid_email?(email_address)
84
- email_address.match(URI::MailTo::EMAIL_REGEXP).present?
83
+ def
84
+ valid_email?(email_address)
85
+ email_address.match(URI::MailTo::EMAIL_REGEXP)
85
86
  rescue StandardError
86
87
  false
87
88
  end
88
89
 
89
90
  def valid_profile_data?(profile_data)
90
- JSON.parse(profile_data.to_json)
91
- true
92
- rescue StandardError
93
- false
91
+ !profile_data.is_a?(String)
94
92
  end
95
93
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: maxemail_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.11
4
+ version: 2.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Murray Catto
@@ -53,8 +53,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  requirements: []
56
- rubyforge_project:
57
- rubygems_version: 2.7.8
56
+ rubygems_version: 3.0.1
58
57
  signing_key:
59
58
  specification_version: 4
60
59
  summary: Maxemails API wrapped in a gem