maxemail_api 2.0.4 → 2.0.5

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 +17 -0
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8f2f46edfe4cf6e3697cfe69d257ca3b53eb21b7
4
- data.tar.gz: f9b8ae4e9ca2274a1eb008b5a641ec12c27c610f
3
+ metadata.gz: a4a2b547f748e86562bf810104cb0687ff8a079b
4
+ data.tar.gz: b51fe82deb6d99810a99674e43feb2cfcb1b5f48
5
5
  SHA512:
6
- metadata.gz: 182a88f6884f68b080ff5fec245c56ce91f1972e31d4655de0875b6628a63cef40555bd19571133ddc5d8a1921e61afa8b8908fdf19c72c60294fc266d5c6326
7
- data.tar.gz: a910f39a63a9a4e8108233b8f2b0cce998b6f4679c6ceaf1b6716c3e636b85147ed7d083ff7a11cbf2a431fe6c9bb71f2ca79128f028477030f38a348d017883
6
+ metadata.gz: 6e825d43aa962c940df43d1773942269ccef7f643f9168bd295f9a7f9b65cc9316382cccb0b24b6a54004b9599650774640ccd21e8d8c0554e7dd0fb102a93bf
7
+ data.tar.gz: 9cff876cb90f46df2abe7ae16a2bf60683a4cea36ebab52be59cefbeccd463e40337fbe12c7b951319e3cbc991e82b748634c99fc717fc5366e363783d19ebf7
@@ -7,6 +7,23 @@ module MaxemailApiTriggered
7
7
  MaxemailApiTriggered.send_triggered(email_address: email_address, email_id: email_id, profile_data: profile_data)
8
8
  end
9
9
 
10
+ def trigger_folder(folder_id:, email_address:, profile_data: )
11
+ return MaxemailApiResponse.new(data: {}, success: false, message: 'Folder not found') if folder_id.nil?
12
+ return MaxemailApiResponse.new(data: {}, success: false, message: 'Invalid Profile data') unless valid_profile_data?(profile_data)
13
+ return MaxemailApiResponse.new(data: {}, success: false, message: 'Invalid Email address') unless valid_email?(email_address)
14
+ response = JSON.parse(MaxemailApiShared.send_request(params: { method: 'triggerFolder',
15
+ emailAddress: email_address,
16
+ folder_id: folder_id,
17
+ profileData: profile_data.to_json }, method: 'email_send').body)
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
20
+ rescue StandardError => e
21
+ puts 'MaxemailApiResponse Error:'
22
+ puts e
23
+ puts 'END MaxemailApiResponse Error:'
24
+ return MaxemailApiResponse.new(data: {}, success: false, message: 'Server error') if response['success'] == false
25
+ end
26
+
10
27
  def send_triggered(email_address: nil, email_id: nil, profile_data: nil)
11
28
  return MaxemailApiResponse.new(data: {}, success: false, message: 'Template not found') if email_id.nil?
12
29
  return MaxemailApiResponse.new(data: {}, success: false, message: 'Invalid Profile data') unless valid_profile_data?(profile_data)
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.4
4
+ version: 2.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Murray Catto