maxemail_api 2.0.4 → 2.0.5
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/lib/maxemail_api/triggered.rb +17 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a4a2b547f748e86562bf810104cb0687ff8a079b
|
4
|
+
data.tar.gz: b51fe82deb6d99810a99674e43feb2cfcb1b5f48
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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)
|