@@ -5,7 +5,6 @@ |
||
5 | 5 | use DiegoCaprioli\Larachimp\Services\Larachimp; |
6 | 6 | use DiegoCaprioli\Larachimp\Traits\BasicLogging; |
7 | 7 | use Illuminate\Contracts\Logging\Log; |
8 | -use Illuminate\Support\Facades\App; |
|
9 | 8 | |
10 | 9 | class MailchimpManager |
11 | 10 | { |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | throw new \Exception('The Mailchimp API key is not properly set. Please verify the apikey configuration.'); |
45 | 45 | } |
46 | 46 | |
47 | - $response = LarachimpFacade::request('GET', 'lists/'.$this->listId, [ |
|
47 | + $response = LarachimpFacade::request('GET', 'lists/' . $this->listId, [ |
|
48 | 48 | 'query' => ['fields' => 'id,web_id,name'], |
49 | 49 | ]); |
50 | 50 | if (empty($response)) { |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | */ |
95 | 95 | public function addListMember(LarachimpListMember $member) |
96 | 96 | { |
97 | - return LarachimpFacade::request('POST', 'lists/'.$this->listId.'/members', [ |
|
97 | + return LarachimpFacade::request('POST', 'lists/' . $this->listId . '/members', [ |
|
98 | 98 | 'body' => json_encode([ |
99 | 99 | 'email_address' => $member->getEmail(), |
100 | 100 | 'status' => $member->isSubscribedToMailchimpList() ? 'subscribed' : 'unsubscribed', |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | */ |
114 | 114 | public function updateListMember(LarachimpListMember $member, $subscriberHash) |
115 | 115 | { |
116 | - return LarachimpFacade::request('PATCH', 'lists/'.$this->listId.'/members/'.$subscriberHash, [ |
|
116 | + return LarachimpFacade::request('PATCH', 'lists/' . $this->listId . '/members/' . $subscriberHash, [ |
|
117 | 117 | 'body' => json_encode([ |
118 | 118 | 'status' => $member->isSubscribedToMailchimpList() ? 'subscribed' : 'unsubscribed', |
119 | 119 | ]), |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | // Search the user by email in the list |
137 | 137 | $mailchimpListMember = $this->searchMember($member); |
138 | 138 | |
139 | - $this->logInfo('Member Found = '.var_export($mailchimpListMember, true)); |
|
139 | + $this->logInfo('Member Found = ' . var_export($mailchimpListMember, true)); |
|
140 | 140 | |
141 | 141 | if (empty($mailchimpListMember)) { |
142 | 142 | // Add the user to the list |
@@ -8,7 +8,7 @@ |
||
8 | 8 | */ |
9 | 9 | trait BasicLogging { |
10 | 10 | |
11 | - /** |
|
11 | + /** |
|
12 | 12 | * The logger to user |
13 | 13 | * @var \Illuminate\Contracts\Logging\Log |
14 | 14 | */ |
@@ -41,9 +41,9 @@ discard block |
||
41 | 41 | | from users |
42 | 42 | | |
43 | 43 | */ |
44 | - 'list_id' => env('MAILCHIMP_LIST_ID', '123'), |
|
44 | + 'list_id' => env('MAILCHIMP_LIST_ID', '123'), |
|
45 | 45 | |
46 | - /* |
|
46 | + /* |
|
47 | 47 | |-------------------------------------------------------------------------- |
48 | 48 | | Log error level |
49 | 49 | |-------------------------------------------------------------------------- |
@@ -53,6 +53,6 @@ discard block |
||
53 | 53 | | error: only logs errors |
54 | 54 | | |
55 | 55 | */ |
56 | - 'log_level' => env('LARACHIMP_LOG_LEVEL', 'error'), // info, error |
|
56 | + 'log_level' => env('LARACHIMP_LOG_LEVEL', 'error'), // info, error |
|
57 | 57 | |
58 | 58 | ]; |
59 | 59 | \ No newline at end of file |