litmus-instant 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +33 -0
  3. data/.rspec +2 -0
  4. data/.travis.yml +4 -0
  5. data/Gemfile +4 -0
  6. data/Guardfile +18 -0
  7. data/LICENSE.txt +21 -0
  8. data/README.md +182 -0
  9. data/Rakefile +6 -0
  10. data/bin/console +14 -0
  11. data/bin/setup +7 -0
  12. data/examples/Gemfile +4 -0
  13. data/examples/Gemfile.lock +32 -0
  14. data/examples/README.md +29 -0
  15. data/examples/email/test-email.html +330 -0
  16. data/examples/example_batch.rb +50 -0
  17. data/examples/example_simple.rb +35 -0
  18. data/fixtures/vcr_cassettes/Litmus_Instant/client_configurations/returns_a_Hash_of_clients_and_their_available_options.yml +419 -0
  19. data/fixtures/vcr_cassettes/Litmus_Instant/clients/returns_an_array_of_client_names.yml +86 -0
  20. data/fixtures/vcr_cassettes/Litmus_Instant/create_email/authenticated_with_invalid_email_Hash_raise_a_request_error.yml +77 -0
  21. data/fixtures/vcr_cassettes/Litmus_Instant/create_email/authenticated_with_valid_email_Hash_optional_end_user_id_is_relayed.yml +44 -0
  22. data/fixtures/vcr_cassettes/Litmus_Instant/create_email/authenticated_with_valid_email_Hash_prerequest_configurations_is_relayed.yml +55 -0
  23. data/fixtures/vcr_cassettes/Litmus_Instant/create_email/authenticated_with_valid_email_Hash_response_.yml +81 -0
  24. data/fixtures/vcr_cassettes/Litmus_Instant/create_email/unauthenticated_raises_an_authentication_error.yml +41 -0
  25. data/fixtures/vcr_cassettes/Litmus_Instant/get_preview/raises_NotFound_for_an_expired_email_guid.yml +1668 -0
  26. data/fixtures/vcr_cassettes/Litmus_Instant/get_preview/raises_RequestError_for_an_invalid_client.yml +79 -0
  27. data/fixtures/vcr_cassettes/Litmus_Instant/get_preview/raises_RequestError_for_an_invalid_email_guid.yml +39 -0
  28. data/fixtures/vcr_cassettes/Litmus_Instant/get_preview/returns_a_Hash_of_the_image_types.yml +85 -0
  29. data/fixtures/vcr_cassettes/Litmus_Instant/get_preview/supports_optional_capture_configuration.yml +121 -0
  30. data/fixtures/vcr_cassettes/Litmus_Instant/prefetch_previews/raises_RequestError_for_an_invalid_email_guid.yml +39 -0
  31. data/fixtures/vcr_cassettes/Litmus_Instant/prefetch_previews/raises_RequestError_if_any_invalid_configurations_are_present.yml +79 -0
  32. data/fixtures/vcr_cassettes/Litmus_Instant/prefetch_previews/responds_with_an_array_of_the_requested_configurations.yml +88 -0
  33. data/lib/litmus/instant.rb +216 -0
  34. data/lib/litmus/instant/version.rb +5 -0
  35. data/litmus-instant.gemspec +39 -0
  36. metadata +194 -0
@@ -0,0 +1,79 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://<API_KEY>:@instant-api.litmus.com/v1/emails
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"plain_text":"Hej världen! Kärlek, den svenska kocken."}'
9
+ headers:
10
+ Content-Type:
11
+ - application/json
12
+ Accept:
13
+ - application/json
14
+ response:
15
+ status:
16
+ code: 200
17
+ message: OK
18
+ headers:
19
+ Server:
20
+ - nginx
21
+ Date:
22
+ - Tue, 06 Oct 2015 10:40:05 GMT
23
+ Content-Type:
24
+ - application/json;charset=utf-8
25
+ Content-Length:
26
+ - '58'
27
+ Connection:
28
+ - keep-alive
29
+ Strict-Transport-Security:
30
+ - max-age=3600; includeSubdomains; preload
31
+ X-Frame-Options:
32
+ - DENY
33
+ X-Content-Type-Options:
34
+ - nosniff
35
+ body:
36
+ encoding: UTF-8
37
+ string: |-
38
+ {
39
+ "email_guid": "6c8862e2-b10d-4753-85d8-340c91c0b071"
40
+ }
41
+ http_version:
42
+ recorded_at: Tue, 06 Oct 2015 10:40:39 GMT
43
+ - request:
44
+ method: get
45
+ uri: https://instant-api.litmus.com/v1/emails/6c8862e2-b10d-4753-85d8-340c91c0b071/previews/OL2001MYSPACEODYSSEY
46
+ body:
47
+ encoding: US-ASCII
48
+ string: ''
49
+ headers:
50
+ Content-Type:
51
+ - application/json
52
+ Accept:
53
+ - application/json
54
+ response:
55
+ status:
56
+ code: 400
57
+ message: Bad Request
58
+ headers:
59
+ Server:
60
+ - nginx
61
+ Date:
62
+ - Tue, 06 Oct 2015 10:40:36 GMT
63
+ Content-Type:
64
+ - application/json;charset=utf-8
65
+ Content-Length:
66
+ - '102'
67
+ Connection:
68
+ - keep-alive
69
+ body:
70
+ encoding: UTF-8
71
+ string: |-
72
+ {
73
+ "status": 400,
74
+ "title": "Bad Request",
75
+ "description": "'client' must be valid, see /clients"
76
+ }
77
+ http_version:
78
+ recorded_at: Tue, 06 Oct 2015 10:40:40 GMT
79
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,39 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://instant-api.litmus.com/v1/emails/NOT-A-GUID/previews/PLAINTEXT
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Content-Type:
11
+ - application/json
12
+ Accept:
13
+ - application/json
14
+ response:
15
+ status:
16
+ code: 400
17
+ message: Bad Request
18
+ headers:
19
+ Server:
20
+ - nginx
21
+ Date:
22
+ - Tue, 06 Oct 2015 10:40:35 GMT
23
+ Content-Type:
24
+ - application/json;charset=utf-8
25
+ Content-Length:
26
+ - '115'
27
+ Connection:
28
+ - keep-alive
29
+ body:
30
+ encoding: UTF-8
31
+ string: |-
32
+ {
33
+ "status": 400,
34
+ "title": "Bad Request",
35
+ "description": "'email_guid' must match format of a standard GUID"
36
+ }
37
+ http_version:
38
+ recorded_at: Tue, 06 Oct 2015 10:40:38 GMT
39
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,85 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://<API_KEY>:@instant-api.litmus.com/v1/emails
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"plain_text":"Hej världen! Kärlek, den svenska kocken."}'
9
+ headers:
10
+ Content-Type:
11
+ - application/json
12
+ Accept:
13
+ - application/json
14
+ response:
15
+ status:
16
+ code: 200
17
+ message: OK
18
+ headers:
19
+ Server:
20
+ - nginx
21
+ Date:
22
+ - Tue, 06 Oct 2015 10:40:37 GMT
23
+ Content-Type:
24
+ - application/json;charset=utf-8
25
+ Content-Length:
26
+ - '58'
27
+ Connection:
28
+ - keep-alive
29
+ Strict-Transport-Security:
30
+ - max-age=3600; includeSubdomains; preload
31
+ X-Frame-Options:
32
+ - DENY
33
+ X-Content-Type-Options:
34
+ - nosniff
35
+ body:
36
+ encoding: UTF-8
37
+ string: |-
38
+ {
39
+ "email_guid": "6c8862e2-b10d-4753-85d8-340c91c0b071"
40
+ }
41
+ http_version:
42
+ recorded_at: Tue, 06 Oct 2015 10:40:41 GMT
43
+ - request:
44
+ method: get
45
+ uri: https://instant-api.litmus.com/v1/emails/6c8862e2-b10d-4753-85d8-340c91c0b071/previews/PLAINTEXT
46
+ body:
47
+ encoding: US-ASCII
48
+ string: ''
49
+ headers:
50
+ Content-Type:
51
+ - application/json
52
+ Accept:
53
+ - application/json
54
+ response:
55
+ status:
56
+ code: 200
57
+ message: OK
58
+ headers:
59
+ Server:
60
+ - nginx
61
+ Date:
62
+ - Tue, 06 Oct 2015 10:40:09 GMT
63
+ Content-Type:
64
+ - application/json;charset=utf-8
65
+ Content-Length:
66
+ - '421'
67
+ Connection:
68
+ - keep-alive
69
+ Strict-Transport-Security:
70
+ - max-age=3600; includeSubdomains; preload
71
+ X-Frame-Options:
72
+ - DENY
73
+ X-Content-Type-Options:
74
+ - nosniff
75
+ body:
76
+ encoding: UTF-8
77
+ string: |-
78
+ {
79
+ "full_url": "https://PLAINTEXT.capture.litmuscdn.com/6c8862e2-b10d-4753-85d8-340c91c0b071/results/plaintext-vertical-allowed.png",
80
+ "thumb_url": "https://PLAINTEXT.capture.litmuscdn.com/6c8862e2-b10d-4753-85d8-340c91c0b071/results/plaintext-vertical-allowed-thumb.png",
81
+ "thumb450_url": "https://PLAINTEXT.capture.litmuscdn.com/6c8862e2-b10d-4753-85d8-340c91c0b071/results/plaintext-vertical-allowed-thumb450.png"
82
+ }
83
+ http_version:
84
+ recorded_at: Tue, 06 Oct 2015 10:40:43 GMT
85
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,121 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://<API_KEY>:@instant-api.litmus.com/v1/emails
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"plain_text":"Hej världen! Kärlek, den svenska kocken."}'
9
+ headers:
10
+ Content-Type:
11
+ - application/json
12
+ Accept:
13
+ - application/json
14
+ response:
15
+ status:
16
+ code: 200
17
+ message: OK
18
+ headers:
19
+ Server:
20
+ - nginx
21
+ Date:
22
+ - Thu, 08 Oct 2015 15:56:11 GMT
23
+ Content-Type:
24
+ - application/json;charset=utf-8
25
+ Content-Length:
26
+ - '58'
27
+ Connection:
28
+ - keep-alive
29
+ Strict-Transport-Security:
30
+ - max-age=3600; includeSubdomains; preload
31
+ X-Frame-Options:
32
+ - DENY
33
+ X-Content-Type-Options:
34
+ - nosniff
35
+ body:
36
+ encoding: UTF-8
37
+ string: |-
38
+ {
39
+ "email_guid": "93b5954d-c7b5-437d-96d9-9ad6c1717f84"
40
+ }
41
+ http_version:
42
+ recorded_at: Thu, 08 Oct 2015 15:56:15 GMT
43
+ - request:
44
+ method: get
45
+ uri: https://instant-api.litmus.com/v1/emails/93b5954d-c7b5-437d-96d9-9ad6c1717f84/previews/IPAD?images=blocked&orientation=vertical
46
+ body:
47
+ encoding: US-ASCII
48
+ string: ''
49
+ headers:
50
+ Content-Type:
51
+ - application/json
52
+ Accept:
53
+ - application/json
54
+ response:
55
+ status:
56
+ code: 400
57
+ message: Bad Request
58
+ headers:
59
+ Server:
60
+ - nginx
61
+ Date:
62
+ - Thu, 08 Oct 2015 15:55:40 GMT
63
+ Content-Type:
64
+ - application/json;charset=utf-8
65
+ Content-Length:
66
+ - '170'
67
+ Connection:
68
+ - keep-alive
69
+ body:
70
+ encoding: UTF-8
71
+ string: |-
72
+ {
73
+ "status": 400,
74
+ "title": "Bad Request",
75
+ "description": "Invalid client configuration - 'blocked' images option not valid for 'IPAD', see /clients/configurations"
76
+ }
77
+ http_version:
78
+ recorded_at: Thu, 08 Oct 2015 15:56:15 GMT
79
+ - request:
80
+ method: get
81
+ uri: https://instant-api.litmus.com/v1/emails/93b5954d-c7b5-437d-96d9-9ad6c1717f84/previews/OL2010?images=blocked&orientation=vertical
82
+ body:
83
+ encoding: US-ASCII
84
+ string: ''
85
+ headers:
86
+ Content-Type:
87
+ - application/json
88
+ Accept:
89
+ - application/json
90
+ response:
91
+ status:
92
+ code: 200
93
+ message: OK
94
+ headers:
95
+ Server:
96
+ - nginx
97
+ Date:
98
+ - Thu, 08 Oct 2015 15:56:28 GMT
99
+ Content-Type:
100
+ - application/json;charset=utf-8
101
+ Content-Length:
102
+ - '403'
103
+ Connection:
104
+ - keep-alive
105
+ Strict-Transport-Security:
106
+ - max-age=3600; includeSubdomains; preload
107
+ X-Frame-Options:
108
+ - DENY
109
+ X-Content-Type-Options:
110
+ - nosniff
111
+ body:
112
+ encoding: UTF-8
113
+ string: |-
114
+ {
115
+ "full_url": "https://OL2010.capture.litmuscdn.com/93b5954d-c7b5-437d-96d9-9ad6c1717f84/results/ol2010-vertical-blocked.png",
116
+ "thumb_url": "https://OL2010.capture.litmuscdn.com/93b5954d-c7b5-437d-96d9-9ad6c1717f84/results/ol2010-vertical-blocked-thumb.png",
117
+ "thumb450_url": "https://OL2010.capture.litmuscdn.com/93b5954d-c7b5-437d-96d9-9ad6c1717f84/results/ol2010-vertical-blocked-thumb450.png"
118
+ }
119
+ http_version:
120
+ recorded_at: Thu, 08 Oct 2015 15:56:32 GMT
121
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,39 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://instant-api.litmus.com/v1/emails/NOT-A-GUID/previews/prefetch
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"configurations":[{"client":"OL2010"}]}'
9
+ headers:
10
+ Content-Type:
11
+ - application/json
12
+ Accept:
13
+ - application/json
14
+ response:
15
+ status:
16
+ code: 400
17
+ message: Bad Request
18
+ headers:
19
+ Server:
20
+ - nginx
21
+ Date:
22
+ - Tue, 06 Oct 2015 10:40:11 GMT
23
+ Content-Type:
24
+ - application/json;charset=utf-8
25
+ Content-Length:
26
+ - '115'
27
+ Connection:
28
+ - keep-alive
29
+ body:
30
+ encoding: UTF-8
31
+ string: |-
32
+ {
33
+ "status": 400,
34
+ "title": "Bad Request",
35
+ "description": "'email_guid' must match format of a standard GUID"
36
+ }
37
+ http_version:
38
+ recorded_at: Tue, 06 Oct 2015 10:40:45 GMT
39
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,79 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://<API_KEY>:@instant-api.litmus.com/v1/emails
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"plain_text":"Hej världen! Kärlek, den svenska kocken."}'
9
+ headers:
10
+ Content-Type:
11
+ - application/json
12
+ Accept:
13
+ - application/json
14
+ response:
15
+ status:
16
+ code: 200
17
+ message: OK
18
+ headers:
19
+ Server:
20
+ - nginx
21
+ Date:
22
+ - Tue, 06 Oct 2015 10:40:10 GMT
23
+ Content-Type:
24
+ - application/json;charset=utf-8
25
+ Content-Length:
26
+ - '58'
27
+ Connection:
28
+ - keep-alive
29
+ Strict-Transport-Security:
30
+ - max-age=3600; includeSubdomains; preload
31
+ X-Frame-Options:
32
+ - DENY
33
+ X-Content-Type-Options:
34
+ - nosniff
35
+ body:
36
+ encoding: UTF-8
37
+ string: |-
38
+ {
39
+ "email_guid": "6c8862e2-b10d-4753-85d8-340c91c0b071"
40
+ }
41
+ http_version:
42
+ recorded_at: Tue, 06 Oct 2015 10:40:44 GMT
43
+ - request:
44
+ method: post
45
+ uri: https://instant-api.litmus.com/v1/emails/6c8862e2-b10d-4753-85d8-340c91c0b071/previews/prefetch
46
+ body:
47
+ encoding: UTF-8
48
+ string: '{"configurations":[{"client":"OL2010"},{"client":"OL2001MYSPACEODYSSEY"}]}'
49
+ headers:
50
+ Content-Type:
51
+ - application/json
52
+ Accept:
53
+ - application/json
54
+ response:
55
+ status:
56
+ code: 400
57
+ message: Bad Request
58
+ headers:
59
+ Server:
60
+ - nginx
61
+ Date:
62
+ - Tue, 06 Oct 2015 10:40:41 GMT
63
+ Content-Type:
64
+ - application/json;charset=utf-8
65
+ Content-Length:
66
+ - '124'
67
+ Connection:
68
+ - keep-alive
69
+ body:
70
+ encoding: UTF-8
71
+ string: |-
72
+ {
73
+ "status": 400,
74
+ "title": "Bad Request",
75
+ "description": "Each client must be valid, OL2001MYSPACEODYSSEY is unknown"
76
+ }
77
+ http_version:
78
+ recorded_at: Tue, 06 Oct 2015 10:40:45 GMT
79
+ recorded_with: VCR 2.9.3