wj-mailgun-ruby 1.1.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +23 -0
  3. data/.rubocop.yml +8 -0
  4. data/.rubocop_todo.yml +22 -0
  5. data/.ruby-env.yml.example +12 -0
  6. data/.ruby-version +1 -0
  7. data/.travis.yml +24 -0
  8. data/Gemfile +6 -0
  9. data/LICENSE +191 -0
  10. data/README.md +241 -0
  11. data/Rakefile +35 -0
  12. data/docs/Domains.md +54 -0
  13. data/docs/Events.md +46 -0
  14. data/docs/MessageBuilder.md +105 -0
  15. data/docs/Messages.md +107 -0
  16. data/docs/OptInHandler.md +103 -0
  17. data/docs/Snippets.md +526 -0
  18. data/docs/Suppressions.md +82 -0
  19. data/docs/Webhooks.md +40 -0
  20. data/lib/mailgun-ruby.rb +2 -0
  21. data/lib/mailgun.rb +39 -0
  22. data/lib/mailgun/address.rb +45 -0
  23. data/lib/mailgun/chains.rb +16 -0
  24. data/lib/mailgun/client.rb +199 -0
  25. data/lib/mailgun/domains/domains.rb +84 -0
  26. data/lib/mailgun/events/events.rb +120 -0
  27. data/lib/mailgun/exceptions/exceptions.rb +65 -0
  28. data/lib/mailgun/lists/opt_in_handler.rb +58 -0
  29. data/lib/mailgun/messages/batch_message.rb +125 -0
  30. data/lib/mailgun/messages/message_builder.rb +413 -0
  31. data/lib/mailgun/response.rb +62 -0
  32. data/lib/mailgun/suppressions.rb +270 -0
  33. data/lib/mailgun/version.rb +4 -0
  34. data/lib/mailgun/webhooks/webhooks.rb +101 -0
  35. data/lib/railgun.rb +8 -0
  36. data/lib/railgun/attachment.rb +56 -0
  37. data/lib/railgun/errors.rb +27 -0
  38. data/lib/railgun/mailer.rb +161 -0
  39. data/lib/railgun/message.rb +17 -0
  40. data/lib/railgun/railtie.rb +9 -0
  41. data/mailgun.gemspec +37 -0
  42. data/spec/integration/bounces_spec.rb +44 -0
  43. data/spec/integration/campaign_spec.rb +60 -0
  44. data/spec/integration/complaints_spec.rb +38 -0
  45. data/spec/integration/domains_spec.rb +39 -0
  46. data/spec/integration/email_validation_spec.rb +57 -0
  47. data/spec/integration/events_spec.rb +28 -0
  48. data/spec/integration/list_members_spec.rb +63 -0
  49. data/spec/integration/list_spec.rb +58 -0
  50. data/spec/integration/mailgun_spec.rb +121 -0
  51. data/spec/integration/messages/sample_data/mime.txt +38 -0
  52. data/spec/integration/routes_spec.rb +74 -0
  53. data/spec/integration/stats_spec.rb +15 -0
  54. data/spec/integration/suppressions_spec.rb +126 -0
  55. data/spec/integration/unsubscribes_spec.rb +42 -0
  56. data/spec/integration/webhook_spec.rb +54 -0
  57. data/spec/spec_helper.rb +45 -0
  58. data/spec/unit/connection/test_client.rb +99 -0
  59. data/spec/unit/events/events_spec.rb +50 -0
  60. data/spec/unit/lists/opt_in_handler_spec.rb +24 -0
  61. data/spec/unit/mailgun_spec.rb +127 -0
  62. data/spec/unit/messages/batch_message_spec.rb +131 -0
  63. data/spec/unit/messages/message_builder_spec.rb +584 -0
  64. data/spec/unit/messages/sample_data/mailgun_icon.png +0 -0
  65. data/spec/unit/messages/sample_data/mime.txt +38 -0
  66. data/spec/unit/messages/sample_data/rackspace_logo.jpg +0 -0
  67. data/vcr_cassettes/bounces.yml +175 -0
  68. data/vcr_cassettes/complaints.yml +175 -0
  69. data/vcr_cassettes/domains.todo.yml +42 -0
  70. data/vcr_cassettes/domains.yml +360 -0
  71. data/vcr_cassettes/email_validation.yml +167 -0
  72. data/vcr_cassettes/events.yml +108 -0
  73. data/vcr_cassettes/exceptions.yml +45 -0
  74. data/vcr_cassettes/list_members.yml +320 -0
  75. data/vcr_cassettes/mailing_list.todo.yml +43 -0
  76. data/vcr_cassettes/mailing_list.yml +390 -0
  77. data/vcr_cassettes/routes.yml +359 -0
  78. data/vcr_cassettes/send_message.yml +107 -0
  79. data/vcr_cassettes/stats.yml +44 -0
  80. data/vcr_cassettes/suppressions.yml +676 -0
  81. data/vcr_cassettes/unsubscribes.yml +191 -0
  82. data/vcr_cassettes/webhooks.yml +276 -0
  83. metadata +263 -0
@@ -0,0 +1,167 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api:<PUBKEY>@api.mailgun.net/v3/address/parse?addresses=Alice%20%3Calice@example.com%3E%3Bbob@example.com%3Bexample.org&syntax_only=true
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - "*/*"
12
+ Accept-Encoding:
13
+ - gzip, deflate
14
+ User-Agent:
15
+ - rest-client/2.0.0 (linux-gnu x86_64) ruby/2.3.1p112
16
+ Host:
17
+ - api.mailgun.net
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Server:
24
+ - nginx
25
+ Date:
26
+ - Wed, 26 Oct 2016 22:44:07 GMT
27
+ Content-Type:
28
+ - application/json
29
+ Content-Length:
30
+ - '118'
31
+ Connection:
32
+ - keep-alive
33
+ Content-Disposition:
34
+ - inline
35
+ Access-Control-Allow-Origin:
36
+ - "*"
37
+ Access-Control-Max-Age:
38
+ - '600'
39
+ Access-Control-Allow-Methods:
40
+ - GET, POST, PUT, DELETE, OPTIONS
41
+ Access-Control-Allow-Headers:
42
+ - Content-Type, x-requested-with
43
+ body:
44
+ encoding: UTF-8
45
+ string: |-
46
+ {
47
+ "parsed": [
48
+ "Alice <alice@example.com>",
49
+ "bob@example.com"
50
+ ],
51
+ "unparseable": [
52
+ "example.org"
53
+ ]
54
+ }
55
+ http_version:
56
+ recorded_at: Wed, 26 Oct 2016 22:44:50 GMT
57
+ - request:
58
+ method: get
59
+ uri: https://api:<PUBKEY>@api.mailgun.net/v3/address/validate?address=alice@mailgun.net
60
+ body:
61
+ encoding: US-ASCII
62
+ string: ''
63
+ headers:
64
+ Accept:
65
+ - "*/*"
66
+ Accept-Encoding:
67
+ - gzip, deflate
68
+ User-Agent:
69
+ - rest-client/2.0.0 (linux-gnu x86_64) ruby/2.3.1p112
70
+ Host:
71
+ - api.mailgun.net
72
+ response:
73
+ status:
74
+ code: 200
75
+ message: OK
76
+ headers:
77
+ Server:
78
+ - nginx
79
+ Date:
80
+ - Wed, 26 Oct 2016 22:44:08 GMT
81
+ Content-Type:
82
+ - application/json
83
+ Content-Length:
84
+ - '179'
85
+ Connection:
86
+ - keep-alive
87
+ Content-Disposition:
88
+ - inline
89
+ Access-Control-Allow-Origin:
90
+ - "*"
91
+ Access-Control-Max-Age:
92
+ - '600'
93
+ Access-Control-Allow-Methods:
94
+ - GET, POST, PUT, DELETE, OPTIONS
95
+ Access-Control-Allow-Headers:
96
+ - Content-Type, x-requested-with
97
+ body:
98
+ encoding: UTF-8
99
+ string: |-
100
+ {
101
+ "address": "alice@mailgun.net",
102
+ "did_you_mean": null,
103
+ "is_valid": true,
104
+ "parts": {
105
+ "display_name": null,
106
+ "domain": "mailgun.net",
107
+ "local_part": "alice"
108
+ }
109
+ }
110
+ http_version:
111
+ recorded_at: Wed, 26 Oct 2016 22:44:50 GMT
112
+ - request:
113
+ method: get
114
+ uri: https://api:<PUBKEY>@api.mailgun.net/v3/address/validate?address=example.org
115
+ body:
116
+ encoding: US-ASCII
117
+ string: ''
118
+ headers:
119
+ Accept:
120
+ - "*/*"
121
+ Accept-Encoding:
122
+ - gzip, deflate
123
+ User-Agent:
124
+ - rest-client/2.0.0 (linux-gnu x86_64) ruby/2.3.1p112
125
+ Host:
126
+ - api.mailgun.net
127
+ response:
128
+ status:
129
+ code: 200
130
+ message: OK
131
+ headers:
132
+ Server:
133
+ - nginx
134
+ Date:
135
+ - Wed, 26 Oct 2016 22:44:08 GMT
136
+ Content-Type:
137
+ - application/json
138
+ Content-Length:
139
+ - '162'
140
+ Connection:
141
+ - keep-alive
142
+ Content-Disposition:
143
+ - inline
144
+ Access-Control-Allow-Origin:
145
+ - "*"
146
+ Access-Control-Max-Age:
147
+ - '600'
148
+ Access-Control-Allow-Methods:
149
+ - GET, POST, PUT, DELETE, OPTIONS
150
+ Access-Control-Allow-Headers:
151
+ - Content-Type, x-requested-with
152
+ body:
153
+ encoding: UTF-8
154
+ string: |-
155
+ {
156
+ "address": "example.org",
157
+ "did_you_mean": null,
158
+ "is_valid": false,
159
+ "parts": {
160
+ "display_name": null,
161
+ "domain": null,
162
+ "local_part": null
163
+ }
164
+ }
165
+ http_version:
166
+ recorded_at: Wed, 26 Oct 2016 22:44:50 GMT
167
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,108 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api:<APIKEY>@api.mailgun.net/v3/DOMAIN.TEST/events?limit=1
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - "*/*"
12
+ Accept-Encoding:
13
+ - gzip, deflate
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Server:
22
+ - nginx
23
+ Date:
24
+ - Thu, 07 Jan 2016 22:08:06 GMT
25
+ Content-Type:
26
+ - application/json
27
+ Content-Length:
28
+ - '3336'
29
+ Connection:
30
+ - keep-alive
31
+ Access-Control-Allow-Origin:
32
+ - "*"
33
+ Access-Control-Max-Age:
34
+ - '600'
35
+ Access-Control-Allow-Methods:
36
+ - GET, POST, PUT, DELETE, OPTIONS
37
+ Access-Control-Allow-Headers:
38
+ - Content-Type, x-requested-with
39
+ body:
40
+ encoding: UTF-8
41
+ string: "{\n \"items\": [\n {\n \"tags\": [], \n \"timestamp\":
42
+ 1452204483.41958, \n \"envelope\": {\n \"targets\": \"sally@DOMAIN.TEST\",
43
+ \n \"transport\": \"smtp\", \n \"sender\": \"bob@DOMAIN.TEST\"\n
44
+ \ }, \n \"recipient-domain\": \"DOMAIN.TEST\", \n \"method\":
45
+ \"http\", \n \"campaigns\": [], \n \"user-variables\": {}, \n \"flags\":
46
+ {\n \"is-routed\": null, \n \"is-authenticated\": true, \n \"is-system-test\":
47
+ false, \n \"is-test-mode\": true\n }, \n \"log-level\": \"info\",
48
+ \n \"id\": \"JAx9z641TuGGUyaJlD9sCQ\", \n \"message\": {\n \"headers\":
49
+ {\n \"to\": \"sally@DOMAIN.TEST\", \n \"message-id\": \"20160107220803.53710.46802@DOMAIN.TEST\",
50
+ \n \"from\": \"bob@DOMAIN.TEST\", \n \"subject\": \"Hash
51
+ Integration Test\"\n }, \n \"attachments\": [], \n \"recipients\":
52
+ [\n \"sally@DOMAIN.TEST\"\n ], \n \"size\": 457\n },
53
+ \n \"recipient\": \"sally@DOMAIN.TEST\", \n \"event\": \"accepted\"\n
54
+ \ }\n ], \n \"paging\": {\n \"next\": \"https://api.mailgun.net/v3/DOMAIN.TEST/events/W3siYiI6ICIyMDE2LTAxLTA3VDIyOjA4OjA2LjQ1MiswMDowMCIsICJlIjogIjIwMTYtMDEtMDVUMjI6MDg6MDYuNDUzKzAwOjAwIn0sIHsiYiI6ICIyMDE2LTAxLTA3VDIyOjA4OjAzLjQxOSswMDowMCIsICJlIjogIjIwMTYtMDEtMDVUMjI6MDg6MDYuNDUzKzAwOjAwIn0sIFsiZiJdLCBudWxsLCBbWyJhY2NvdW50LmlkIiwgIjU1ZTA0ZWRlMDQ1Y2E0MzY0MTNiN2I0YSJdLCBbImRvbWFpbi5uYW1lIiwgInJzOTBiNjhmZDM5Y2UyNDE1NjlmZDEwZjUzNGVmOWMwNjUubWFpbGd1bi5vcmciXV0sIDEsICJtZXNzYWdlI0pBeDl6NjQxVHVHR1V5YUpsRDlzQ1EiXQ==\",
55
+ \n \"last\": \"https://api.mailgun.net/v3/DOMAIN.TEST/events/W3siYiI6ICIyMDE2LTAxLTA3VDIyOjA4OjA2LjQ1MiswMDowMCIsICJlIjogIjIwMTYtMDEtMDVUMjI6MDg6MDYuNDUzKzAwOjAwIn0sIHsiYiI6ICIyMDE2LTAxLTA1VDIyOjA4OjA2LjQ1MyswMDowMCIsICJlIjogIjIwMTYtMDEtMDdUMjI6MDg6MDYuNDUyKzAwOjAwIn0sIFsicCIsICJmIl0sIG51bGwsIFtbImFjY291bnQuaWQiLCAiNTVlMDRlZGUwNDVjYTQzNjQxM2I3YjRhIl0sIFsiZG9tYWluLm5hbWUiLCAicnM5MGI2OGZkMzljZTI0MTU2OWZkMTBmNTM0ZWY5YzA2NS5tYWlsZ3VuLm9yZyJdXSwgMSwgbnVsbF0=\",
56
+ \n \"first\": \"https://api.mailgun.net/v3/DOMAIN.TEST/events/W3siYiI6ICIyMDE2LTAxLTA3VDIyOjA4OjA2LjQ1MiswMDowMCIsICJlIjogIjIwMTYtMDEtMDVUMjI6MDg6MDYuNDUzKzAwOjAwIn0sIHsiYiI6ICIyMDE2LTAxLTA3VDIyOjA4OjA2LjQ1MiswMDowMCIsICJlIjogIjIwMTYtMDEtMDVUMjI6MDg6MDYuNDUzKzAwOjAwIn0sIFsiZiJdLCBudWxsLCBbWyJhY2NvdW50LmlkIiwgIjU1ZTA0ZWRlMDQ1Y2E0MzY0MTNiN2I0YSJdLCBbImRvbWFpbi5uYW1lIiwgInJzOTBiNjhmZDM5Y2UyNDE1NjlmZDEwZjUzNGVmOWMwNjUubWFpbGd1bi5vcmciXV0sIDEsIG51bGxd\",
57
+ \n \"previous\": \"https://api.mailgun.net/v3/DOMAIN.TEST/events/W3siYiI6ICIyMDE2LTAxLTA3VDIyOjA4OjA2LjQ1MiswMDowMCIsICJlIjogIjIwMTYtMDEtMDVUMjI6MDg6MDYuNDUzKzAwOjAwIn0sIHsiYiI6ICIyMDE2LTAxLTA3VDIyOjA4OjAzLjQxOSswMDowMCIsICJlIjogIjIwMTYtMDEtMDdUMjI6MDg6MDYuNDUzKzAwOjAwIn0sIFsicCIsICJmIl0sIG51bGwsIFtbImFjY291bnQuaWQiLCAiNTVlMDRlZGUwNDVjYTQzNjQxM2I3YjRhIl0sIFsiZG9tYWluLm5hbWUiLCAicnM5MGI2OGZkMzljZTI0MTU2OWZkMTBmNTM0ZWY5YzA2NS5tYWlsZ3VuLm9yZyJdXSwgMSwgIm1lc3NhZ2UjSkF4OXo2NDFUdUdHVXlhSmxEOXNDUSJd\"\n
58
+ \ }\n}"
59
+ http_version:
60
+ recorded_at: Thu, 07 Jan 2016 22:08:06 GMT
61
+ - request:
62
+ method: get
63
+ uri: https://api:<APIKEY>@api.mailgun.net/v3/DOMAIN.TEST/events
64
+ body:
65
+ encoding: US-ASCII
66
+ string: ''
67
+ headers:
68
+ Accept:
69
+ - "*/*"
70
+ Accept-Encoding:
71
+ - gzip, deflate
72
+ User-Agent:
73
+ - rest-client/2.0.1 (linux-gnu x86_64) ruby/2.3.3p222
74
+ Host:
75
+ - api.mailgun.net
76
+ response:
77
+ status:
78
+ code: 200
79
+ message: OK
80
+ headers:
81
+ Access-Control-Allow-Headers:
82
+ - Content-Type, x-requested-with
83
+ Access-Control-Allow-Methods:
84
+ - GET, POST, PUT, DELETE, OPTIONS
85
+ Access-Control-Allow-Origin:
86
+ - "*"
87
+ Access-Control-Max-Age:
88
+ - '600'
89
+ Content-Type:
90
+ - application/json
91
+ Date:
92
+ - Wed, 10 May 2017 20:06:54 GMT
93
+ Server:
94
+ - nginx
95
+ Content-Length:
96
+ - '2060'
97
+ Connection:
98
+ - keep-alive
99
+ body:
100
+ encoding: UTF-8
101
+ string: "{\n \"items\": [], \n \"paging\": {\n \"next\": \"https://api.mailgun.net/v3/DOMAIN.TEST/events/W3siYiI6ICIyMDE3LTA1LTEwVDIwOjA2OjU0LjU3NiswMDowMCIsICJlIjogIjIwMTctMDUtMDhUMjA6MDY6NTQuNTc3KzAwOjAwIn0sIHsiYiI6ICIyMDE3LTA1LTEwVDIwOjA2OjU0LjU3NiswMDowMCIsICJlIjogIjIwMTctMDUtMDhUMjA6MDY6NTQuNTc3KzAwOjAwIn0sIFsiZiJdLCBudWxsLCBbWyJhY2NvdW50LmlkIiwgIjU4MDUyMTg2NzhmYTE2MTNjNzkwYjUwZiJdLCBbImRvbWFpbi5uYW1lIiwgInNhbmRib3gyOTcwMTUyYWYzZDM0NTU5YmZjN2U3MTcwM2E2Y2YyNC5tYWlsZ3VuLm9yZyJdXSwgMTAwLCBudWxsXQ==\",
102
+ \n \"last\": \"https://api.mailgun.net/v3/DOMAIN.TEST/events/W3siYiI6ICIyMDE3LTA1LTEwVDIwOjA2OjU0LjU3NiswMDowMCIsICJlIjogIjIwMTctMDUtMDhUMjA6MDY6NTQuNTc3KzAwOjAwIn0sIHsiYiI6ICIyMDE3LTA1LTA4VDIwOjA2OjU0LjU3NyswMDowMCIsICJlIjogIjIwMTctMDUtMTBUMjA6MDY6NTQuNTc2KzAwOjAwIn0sIFsicCIsICJmIl0sIG51bGwsIFtbImFjY291bnQuaWQiLCAiNTgwNTIxODY3OGZhMTYxM2M3OTBiNTBmIl0sIFsiZG9tYWluLm5hbWUiLCAic2FuZGJveDI5NzAxNTJhZjNkMzQ1NTliZmM3ZTcxNzAzYTZjZjI0Lm1haWxndW4ub3JnIl1dLCAxMDAsIG51bGxd\",
103
+ \n \"first\": \"https://api.mailgun.net/v3/DOMAIN.TEST/events/W3siYiI6ICIyMDE3LTA1LTEwVDIwOjA2OjU0LjU3NiswMDowMCIsICJlIjogIjIwMTctMDUtMDhUMjA6MDY6NTQuNTc3KzAwOjAwIn0sIHsiYiI6ICIyMDE3LTA1LTEwVDIwOjA2OjU0LjU3NiswMDowMCIsICJlIjogIjIwMTctMDUtMDhUMjA6MDY6NTQuNTc3KzAwOjAwIn0sIFsiZiJdLCBudWxsLCBbWyJhY2NvdW50LmlkIiwgIjU4MDUyMTg2NzhmYTE2MTNjNzkwYjUwZiJdLCBbImRvbWFpbi5uYW1lIiwgInNhbmRib3gyOTcwMTUyYWYzZDM0NTU5YmZjN2U3MTcwM2E2Y2YyNC5tYWlsZ3VuLm9yZyJdXSwgMTAwLCBudWxsXQ==\",
104
+ \n \"previous\": \"https://api.mailgun.net/v3/DOMAIN.TEST/events/W3siYiI6ICIyMDE3LTA1LTEwVDIwOjA2OjU0LjU3NiswMDowMCIsICJlIjogIjIwMTctMDUtMDhUMjA6MDY6NTQuNTc3KzAwOjAwIn0sIHsiYiI6ICIyMDE3LTA1LTEwVDIwOjA2OjU0LjU3NiswMDowMCIsICJlIjogIjIwMTctMDUtMTBUMjA6MDY6NTQuNTc3KzAwOjAwIn0sIFsicCIsICJmIl0sIG51bGwsIFtbImFjY291bnQuaWQiLCAiNTgwNTIxODY3OGZhMTYxM2M3OTBiNTBmIl0sIFsiZG9tYWluLm5hbWUiLCAic2FuZGJveDI5NzAxNTJhZjNkMzQ1NTliZmM3ZTcxNzAzYTZjZjI0Lm1haWxndW4ub3JnIl1dLCAxMDAsIG51bGxd\"\n
105
+ \ }\n}"
106
+ http_version:
107
+ recorded_at: Wed, 10 May 2017 20:06:54 GMT
108
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,45 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api:<APIKEY>@api.mailgun.net/v3/not-our-doma.in/messages
6
+ body:
7
+ encoding: UTF-8
8
+ string: from=sally%40not-our-doma.in&to=bob%40DOMAIN.TEST&subject=Exception+Integration+Test&text=INTEGRATION+TESTING
9
+ headers:
10
+ Accept:
11
+ - "*/*"
12
+ Accept-Encoding:
13
+ - gzip, deflate
14
+ User-Agent:
15
+ - rest-client/2.0.0 (linux-gnu x86_64) ruby/2.3.1p112
16
+ Content-Length:
17
+ - '149'
18
+ Content-Type:
19
+ - application/x-www-form-urlencoded
20
+ Host:
21
+ - api.mailgun.net
22
+ response:
23
+ status:
24
+ code: 404
25
+ message: NOT FOUND
26
+ headers:
27
+ Server:
28
+ - nginx
29
+ Date:
30
+ - Wed, 02 Nov 2016 19:42:44 GMT
31
+ Content-Type:
32
+ - application/json
33
+ Content-Length:
34
+ - '52'
35
+ Connection:
36
+ - keep-alive
37
+ body:
38
+ encoding: UTF-8
39
+ string: |-
40
+ {
41
+ "message": "Domain not found: not-our-doma.in"
42
+ }
43
+ http_version:
44
+ recorded_at: Wed, 02 Nov 2016 19:43:40 GMT
45
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,320 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api:<APIKEY>@api.mailgun.net/v3/lists
6
+ body:
7
+ encoding: US-ASCII
8
+ string: address=integration_test_list%40DOMAIN.TEST&name=Integration%20Test%20List&description=This%20list%20should%20be%20deleted%20automatically.&access_level=members
9
+ headers:
10
+ Accept:
11
+ - "*/*; q=0.5, application/xml"
12
+ Accept-Encoding:
13
+ - gzip, deflate
14
+ Content-Length:
15
+ - '195'
16
+ Content-Type:
17
+ - application/x-www-form-urlencoded
18
+ User-Agent:
19
+ - Ruby
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Server:
26
+ - nginx
27
+ Date:
28
+ - Fri, 08 Jan 2016 20:20:43 GMT
29
+ Content-Type:
30
+ - application/json
31
+ Content-Length:
32
+ - '361'
33
+ Connection:
34
+ - keep-alive
35
+ Content-Disposition:
36
+ - inline
37
+ Access-Control-Allow-Origin:
38
+ - "*"
39
+ Access-Control-Max-Age:
40
+ - '600'
41
+ Access-Control-Allow-Methods:
42
+ - GET, POST, PUT, DELETE, OPTIONS
43
+ Access-Control-Allow-Headers:
44
+ - Content-Type, x-requested-with
45
+ body:
46
+ encoding: UTF-8
47
+ string: |-
48
+ {
49
+ "list": {
50
+ "access_level": "members",
51
+ "address": "integration_test_list@DOMAIN.TEST",
52
+ "created_at": "Fri, 08 Jan 2016 20:20:43 -0000",
53
+ "description": "This list should be deleted automatically.",
54
+ "members_count": 0,
55
+ "name": "Integration Test List"
56
+ },
57
+ "message": "Mailing list has been created"
58
+ }
59
+ http_version:
60
+ recorded_at: Fri, 08 Jan 2016 20:20:43 GMT
61
+ - request:
62
+ method: post
63
+ uri: https://api:<APIKEY>@api.mailgun.net/v3/lists/integration_test_list@DOMAIN.TEST/members
64
+ body:
65
+ encoding: US-ASCII
66
+ string: address=integration_test_member_member%40DOMAIN.TEST&name=Jane%20Doe&subscribed=true&upsert=no
67
+ headers:
68
+ Accept:
69
+ - "*/*; q=0.5, application/xml"
70
+ Accept-Encoding:
71
+ - gzip, deflate
72
+ Content-Length:
73
+ - '129'
74
+ Content-Type:
75
+ - application/x-www-form-urlencoded
76
+ User-Agent:
77
+ - Ruby
78
+ response:
79
+ status:
80
+ code: 200
81
+ message: OK
82
+ headers:
83
+ Server:
84
+ - nginx
85
+ Date:
86
+ - Fri, 08 Jan 2016 20:20:43 GMT
87
+ Content-Type:
88
+ - application/json
89
+ Content-Length:
90
+ - '233'
91
+ Connection:
92
+ - keep-alive
93
+ Content-Disposition:
94
+ - inline
95
+ Access-Control-Allow-Origin:
96
+ - "*"
97
+ Access-Control-Max-Age:
98
+ - '600'
99
+ Access-Control-Allow-Methods:
100
+ - GET, POST, PUT, DELETE, OPTIONS
101
+ Access-Control-Allow-Headers:
102
+ - Content-Type, x-requested-with
103
+ body:
104
+ encoding: UTF-8
105
+ string: |-
106
+ {
107
+ "member": {
108
+ "address": "integration_test_member_member@DOMAIN.TEST",
109
+ "name": "Jane Doe",
110
+ "subscribed": true,
111
+ "vars": {}
112
+ },
113
+ "message": "Mailing list member has been created"
114
+ }
115
+ http_version:
116
+ recorded_at: Fri, 08 Jan 2016 20:20:44 GMT
117
+ - request:
118
+ method: get
119
+ uri: https://api:<APIKEY>@api.mailgun.net/v3/lists/integration_test_list@DOMAIN.TEST/members/integration_test_member_member@DOMAIN.TEST
120
+ body:
121
+ encoding: US-ASCII
122
+ string: ''
123
+ headers:
124
+ Accept:
125
+ - "*/*"
126
+ Accept-Encoding:
127
+ - gzip, deflate
128
+ User-Agent:
129
+ - Ruby
130
+ response:
131
+ status:
132
+ code: 200
133
+ message: OK
134
+ headers:
135
+ Server:
136
+ - nginx
137
+ Date:
138
+ - Fri, 08 Jan 2016 20:20:43 GMT
139
+ Content-Type:
140
+ - application/json
141
+ Content-Length:
142
+ - '180'
143
+ Connection:
144
+ - keep-alive
145
+ Content-Disposition:
146
+ - inline
147
+ Access-Control-Allow-Origin:
148
+ - "*"
149
+ Access-Control-Max-Age:
150
+ - '600'
151
+ Access-Control-Allow-Methods:
152
+ - GET, POST, PUT, DELETE, OPTIONS
153
+ Access-Control-Allow-Headers:
154
+ - Content-Type, x-requested-with
155
+ body:
156
+ encoding: UTF-8
157
+ string: |-
158
+ {
159
+ "member": {
160
+ "address": "integration_test_member_member@DOMAIN.TEST",
161
+ "name": "Jane Doe",
162
+ "subscribed": true,
163
+ "vars": {}
164
+ }
165
+ }
166
+ http_version:
167
+ recorded_at: Fri, 08 Jan 2016 20:20:44 GMT
168
+ - request:
169
+ method: put
170
+ uri: https://api:<APIKEY>@api.mailgun.net/v3/lists/integration_test_list@DOMAIN.TEST/members/integration_test_member_member@DOMAIN.TEST
171
+ body:
172
+ encoding: US-ASCII
173
+ string: name=Jane%20Doe%20Update&subscribed=false
174
+ headers:
175
+ Accept:
176
+ - "*/*; q=0.5, application/xml"
177
+ Accept-Encoding:
178
+ - gzip, deflate
179
+ Content-Length:
180
+ - '41'
181
+ Content-Type:
182
+ - application/x-www-form-urlencoded
183
+ User-Agent:
184
+ - Ruby
185
+ response:
186
+ status:
187
+ code: 200
188
+ message: OK
189
+ headers:
190
+ Server:
191
+ - nginx
192
+ Date:
193
+ - Fri, 08 Jan 2016 20:20:44 GMT
194
+ Content-Type:
195
+ - application/json
196
+ Content-Length:
197
+ - '241'
198
+ Connection:
199
+ - keep-alive
200
+ Content-Disposition:
201
+ - inline
202
+ Access-Control-Allow-Origin:
203
+ - "*"
204
+ Access-Control-Max-Age:
205
+ - '600'
206
+ Access-Control-Allow-Methods:
207
+ - GET, POST, PUT, DELETE, OPTIONS
208
+ Access-Control-Allow-Headers:
209
+ - Content-Type, x-requested-with
210
+ body:
211
+ encoding: UTF-8
212
+ string: |-
213
+ {
214
+ "member": {
215
+ "address": "integration_test_member_member@DOMAIN.TEST",
216
+ "name": "Jane Doe Update",
217
+ "subscribed": false,
218
+ "vars": {}
219
+ },
220
+ "message": "Mailing list member has been updated"
221
+ }
222
+ http_version:
223
+ recorded_at: Fri, 08 Jan 2016 20:20:44 GMT
224
+ - request:
225
+ method: delete
226
+ uri: https://api:<APIKEY>@api.mailgun.net/v3/lists/integration_test_list@DOMAIN.TEST/members/integration_test_member_member@DOMAIN.TEST
227
+ body:
228
+ encoding: US-ASCII
229
+ string: ''
230
+ headers:
231
+ Accept:
232
+ - "*/*; q=0.5, application/xml"
233
+ Accept-Encoding:
234
+ - gzip, deflate
235
+ User-Agent:
236
+ - Ruby
237
+ response:
238
+ status:
239
+ code: 200
240
+ message: OK
241
+ headers:
242
+ Server:
243
+ - nginx
244
+ Date:
245
+ - Fri, 08 Jan 2016 20:20:44 GMT
246
+ Content-Type:
247
+ - application/json
248
+ Content-Length:
249
+ - '169'
250
+ Connection:
251
+ - keep-alive
252
+ Content-Disposition:
253
+ - inline
254
+ Access-Control-Allow-Origin:
255
+ - "*"
256
+ Access-Control-Max-Age:
257
+ - '600'
258
+ Access-Control-Allow-Methods:
259
+ - GET, POST, PUT, DELETE, OPTIONS
260
+ Access-Control-Allow-Headers:
261
+ - Content-Type, x-requested-with
262
+ body:
263
+ encoding: UTF-8
264
+ string: |-
265
+ {
266
+ "member": {
267
+ "address": "integration_test_member_member@DOMAIN.TEST"
268
+ },
269
+ "message": "Mailing list member has been deleted"
270
+ }
271
+ http_version:
272
+ recorded_at: Fri, 08 Jan 2016 20:20:44 GMT
273
+ - request:
274
+ method: delete
275
+ uri: https://api:<APIKEY>@api.mailgun.net/v3/lists/integration_test_list@DOMAIN.TEST
276
+ body:
277
+ encoding: US-ASCII
278
+ string: ''
279
+ headers:
280
+ Accept:
281
+ - "*/*; q=0.5, application/xml"
282
+ Accept-Encoding:
283
+ - gzip, deflate
284
+ User-Agent:
285
+ - Ruby
286
+ response:
287
+ status:
288
+ code: 200
289
+ message: OK
290
+ headers:
291
+ Server:
292
+ - nginx
293
+ Date:
294
+ - Fri, 08 Jan 2016 20:20:44 GMT
295
+ Content-Type:
296
+ - application/json
297
+ Content-Length:
298
+ - '133'
299
+ Connection:
300
+ - keep-alive
301
+ Content-Disposition:
302
+ - inline
303
+ Access-Control-Allow-Origin:
304
+ - "*"
305
+ Access-Control-Max-Age:
306
+ - '600'
307
+ Access-Control-Allow-Methods:
308
+ - GET, POST, PUT, DELETE, OPTIONS
309
+ Access-Control-Allow-Headers:
310
+ - Content-Type, x-requested-with
311
+ body:
312
+ encoding: UTF-8
313
+ string: |-
314
+ {
315
+ "address": "integration_test_list@DOMAIN.TEST",
316
+ "message": "Mailing list has been removed"
317
+ }
318
+ http_version:
319
+ recorded_at: Fri, 08 Jan 2016 20:20:45 GMT
320
+ recorded_with: VCR 3.0.1