File tree Expand file tree Collapse file tree 2 files changed +44
-0
lines changed Expand file tree Collapse file tree 2 files changed +44
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace MailerLiteApi \Api ;
4+
5+ use MailerLiteApi \Common \ApiAbstract ;
6+
7+ class Settings extends ApiAbstract {
8+
9+ protected $ endpoint = 'settings ' ;
10+
11+ /**
12+ * Retrieve double opt in status
13+ *
14+ * @return mixed
15+ */
16+ public function getDoubleOptin ()
17+ {
18+ $ endpoint = $ this ->endpoint . '/double_optin ' ;
19+
20+ $ response = $ this ->restClient ->get ( $ endpoint );
21+
22+ return $ response ['body ' ];
23+ }
24+
25+ public function setDoubleOptin ( $ status ) {
26+
27+ $ endpoint = $ this ->endpoint . '/double_optin ' ;
28+
29+ $ params = array_merge ($ this ->prepareParams (), ['enable ' => $ status ] );
30+
31+ $ response = $ this ->restClient ->post ( $ endpoint , $ params );
32+
33+ return $ response ['body ' ];
34+ }
35+
36+ }
Original file line number Diff line number Diff line change @@ -81,6 +81,14 @@ public function stats()
8181 return new \MailerLiteApi \Api \Stats ($ this ->restClient );
8282 }
8383
84+ /**
85+ * @return \MailerLiteApi\Api\Settings
86+ */
87+ public function settings ()
88+ {
89+ return new \MailerLiteApi \Api \Settings ($ this ->restClient );
90+ }
91+
8492 /**
8593 * @param string $version
8694 * @return string
You can’t perform that action at this time.
0 commit comments