-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from flowdee/master
added new endpoints
- Loading branch information
Showing
3 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
namespace MailerLiteApi\Api; | ||
|
||
use MailerLiteApi\Common\ApiAbstract; | ||
|
||
class Settings extends ApiAbstract { | ||
|
||
protected $endpoint = 'settings'; | ||
|
||
/** | ||
* Retrieve double opt in status | ||
* | ||
* @return mixed | ||
*/ | ||
public function getDoubleOptin() | ||
{ | ||
$endpoint = $this->endpoint . '/double_optin'; | ||
|
||
$response = $this->restClient->get( $endpoint ); | ||
|
||
return $response['body']; | ||
} | ||
|
||
public function setDoubleOptin( $status ) { | ||
|
||
$endpoint = $this->endpoint . '/double_optin'; | ||
|
||
$params = array_merge($this->prepareParams(), ['enable' => $status] ); | ||
|
||
$response = $this->restClient->post( $endpoint, $params ); | ||
|
||
return $response['body']; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters