@@ -93,7 +93,7 @@ |
||
| 93 | 93 | $response = curl_exec($ch); |
| 94 | 94 | curl_close($ch); |
| 95 | 95 | } |
| 96 | - if($mailchimpStatus ==1) { |
|
| 96 | + if ($mailchimpStatus == 1) { |
|
| 97 | 97 | $mailchimp = new \App\Http\Controllers\Common\MailChimpController(); |
| 98 | 98 | $r = $mailchimp->addSubscriber($user->email); |
| 99 | 99 | } |
@@ -116,18 +116,18 @@ discard block |
||
| 116 | 116 | ); |
| 117 | 117 | |
| 118 | 118 | return\ DataTables::of($user->get()) |
| 119 | - ->addColumn('checkbox', function ($model) { |
|
| 119 | + ->addColumn('checkbox', function($model) { |
|
| 120 | 120 | return "<input type='checkbox' class='user_checkbox' |
| 121 | 121 | value=".$model->id.' name=select[] id=check>'; |
| 122 | 122 | }) |
| 123 | - ->addColumn('first_name', function ($model) { |
|
| 123 | + ->addColumn('first_name', function($model) { |
|
| 124 | 124 | return '<a href='.url('clients/'.$model->id).'>' |
| 125 | 125 | .ucfirst($model->first_name).' '.ucfirst($model->last_name).'</a>'; |
| 126 | 126 | }) |
| 127 | - ->addColumn('email', function ($model) { |
|
| 127 | + ->addColumn('email', function($model) { |
|
| 128 | 128 | return $model->email; |
| 129 | 129 | }) |
| 130 | - ->addColumn('created_at', function ($model) { |
|
| 130 | + ->addColumn('created_at', function($model) { |
|
| 131 | 131 | $ends = $model->created_at; |
| 132 | 132 | if ($ends) { |
| 133 | 133 | $date1 = new DateTime($ends); |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | return $end; |
| 140 | 140 | }) |
| 141 | 141 | // ->showColumns('email', 'created_at') |
| 142 | - ->addColumn('active', function ($model) { |
|
| 142 | + ->addColumn('active', function($model) { |
|
| 143 | 143 | if ($model->active == 1) { |
| 144 | 144 | $email = "<span class='glyphicon glyphicon-envelope' |
| 145 | 145 | style='color:green' title='verified email'></span>"; |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | |
| 158 | 158 | return $email.' '.$mobile; |
| 159 | 159 | }) |
| 160 | - ->addColumn('action', function ($model) { |
|
| 160 | + ->addColumn('action', function($model) { |
|
| 161 | 161 | return '<a href='.url('clients/'.$model->id.'/edit') |
| 162 | 162 | ." class='btn btn-sm btn-primary btn-xs'> |
| 163 | 163 | <i class='fa fa-edit' style='color:white;'> </i> Edit</a>" |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | <i class='fa fa-eye' style='color:white;'> </i> View</a>"; |
| 167 | 167 | // return 'hhhh'; |
| 168 | 168 | }) |
| 169 | - ->rawColumns(['checkbox', 'first_name', 'email', 'created_at', 'active', 'action']) |
|
| 169 | + ->rawColumns(['checkbox', 'first_name', 'email', 'created_at', 'active', 'action']) |
|
| 170 | 170 | ->make(true); |
| 171 | 171 | |
| 172 | 172 | // ->searchColumns('email', 'first_name') |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | $user->fill($request->input())->save(); |
| 221 | 221 | $this->sendWelcomeMail($user); |
| 222 | 222 | $mailchimpStatus = StatusSetting::first()->value('mailchimp_status'); |
| 223 | - if($mailchimpStatus ==1) { |
|
| 223 | + if ($mailchimpStatus == 1) { |
|
| 224 | 224 | $mailchimp = new \App\Http\Controllers\Common\MailChimpController(); |
| 225 | 225 | $r = $mailchimp->addSubscriber($user->email); |
| 226 | 226 | } |
@@ -8,7 +8,7 @@ discard block |
||
| 8 | 8 | |
| 9 | 9 | class BaseMailChimpController extends Controller |
| 10 | 10 | { |
| 11 | - public function getLists() |
|
| 11 | + public function getLists() |
|
| 12 | 12 | { |
| 13 | 13 | try { |
| 14 | 14 | $result = $this->mailchimp->request('lists'); |
@@ -51,17 +51,17 @@ discard block |
||
| 51 | 51 | ->pluck('mailchimp_group_cat_id')->first(); |
| 52 | 52 | } |
| 53 | 53 | if ($interestGroupIdForNo && $productGroupId) { |
| 54 | - $result = $this->mailchimp->patch("lists/$this->list_id/members/$hash", [ |
|
| 55 | - 'interests' => [$interestGroupIdForNo => true, $interestGroupIdForYes=>false, $productGroupId =>true], |
|
| 56 | - //refer to https://us7.api.mailchimp.com/playground |
|
| 57 | - ]); |
|
| 54 | + $result = $this->mailchimp->patch("lists/$this->list_id/members/$hash", [ |
|
| 55 | + 'interests' => [$interestGroupIdForNo => true, $interestGroupIdForYes=>false, $productGroupId =>true], |
|
| 56 | + //refer to https://us7.api.mailchimp.com/playground |
|
| 57 | + ]); |
|
| 58 | 58 | } elseif ($interestGroupIdForNo && $productGroupId ==null) { |
| 59 | - $result = $this->mailchimp->patch("lists/$this->list_id/members/$hash", [ |
|
| 60 | - 'interests' => [$interestGroupIdForNo => true, $interestGroupIdForYes=>false], |
|
| 61 | - //refer to https://us7.api.mailchimp.com/playground |
|
| 59 | + $result = $this->mailchimp->patch("lists/$this->list_id/members/$hash", [ |
|
| 60 | + 'interests' => [$interestGroupIdForNo => true, $interestGroupIdForYes=>false], |
|
| 61 | + //refer to https://us7.api.mailchimp.com/playground |
|
| 62 | 62 | } elseif ($productGroupId && $interestGroupIdForNo==null || $interestGroupIdForYes==null) { |
| 63 | - $result = $this->mailchimp->patch("lists/$this->list_id/members/$hash", [ |
|
| 64 | - 'interests' => [$productGroupId =>true], |
|
| 63 | + $result = $this->mailchimp->patch("lists/$this->list_id/members/$hash", [ |
|
| 64 | + 'interests' => [$productGroupId =>true], |
|
| 65 | 65 | } |
| 66 | 66 | } catch (Exception $ex) { |
| 67 | 67 | $exe = json_decode($ex->getMessage(), true); |
@@ -72,9 +72,9 @@ discard block |
||
| 72 | 72 | { |
| 73 | 73 | try { |
| 74 | 74 | $merge_fields = $this->field($email); |
| 75 | - $hash = md5($email); |
|
| 76 | - $isPaidStatus = StatusSetting::select()->value('mailchimp_ispaid_status'); |
|
| 77 | - $productStatusStatus = StatusSetting::select()->value('mailchimp_product_status'); |
|
| 75 | + $hash = md5($email); |
|
| 76 | + $isPaidStatus = StatusSetting::select()->value('mailchimp_ispaid_status'); |
|
| 77 | + $productStatusStatus = StatusSetting::select()->value('mailchimp_product_status'); |
|
| 78 | 78 | if ($isPaidStatus ==1) { |
| 79 | 79 | $interestGroupIdForNo = $this->relation->is_paid_no; //Interest GroupId for IsPaid Is No |
| 80 | 80 | $interestGroupIdForYes = $this->relation->is_paid_yes; //Interest GroupId for IsPaid Is Yes |
@@ -84,20 +84,20 @@ discard block |
||
| 84 | 84 | ->pluck('mailchimp_group_cat_id')->first(); |
| 85 | 85 | } |
| 86 | 86 | if ($interestGroupIdForNo && $productGroupId) { |
| 87 | - $result = $this->mailchimp->patch("lists/$this->list_id/members/$hash", [ |
|
| 88 | - 'interests' => [$interestGroupIdForNo => false, $interestGroupIdForYes=>true, $productGroupId =>true], |
|
| 89 | - //refer to https://us7.api.mailchimp.com/playground |
|
| 90 | - ]); |
|
| 87 | + $result = $this->mailchimp->patch("lists/$this->list_id/members/$hash", [ |
|
| 88 | + 'interests' => [$interestGroupIdForNo => false, $interestGroupIdForYes=>true, $productGroupId =>true], |
|
| 89 | + //refer to https://us7.api.mailchimp.com/playground |
|
| 90 | + ]); |
|
| 91 | 91 | } elseif ($interestGroupIdForNo && $productGroupId ==null) { |
| 92 | - $result = $this->mailchimp->patch("lists/$this->list_id/members/$hash", [ |
|
| 93 | - 'interests' => [$interestGroupIdForNo => false, $interestGroupIdForYes=>true], |
|
| 94 | - //refer to https://us7.api.mailchimp.com/playground |
|
| 92 | + $result = $this->mailchimp->patch("lists/$this->list_id/members/$hash", [ |
|
| 93 | + 'interests' => [$interestGroupIdForNo => false, $interestGroupIdForYes=>true], |
|
| 94 | + //refer to https://us7.api.mailchimp.com/playground |
|
| 95 | 95 | } elseif ($productGroupId && $interestGroupIdForNo==null || $interestGroupIdForYes==null) { |
| 96 | - $result = $this->mailchimp->patch("lists/$this->list_id/members/$hash", [ |
|
| 97 | - 'interests' => [$productGroupId =>true], |
|
| 96 | + $result = $this->mailchimp->patch("lists/$this->list_id/members/$hash", [ |
|
| 97 | + 'interests' => [$productGroupId =>true], |
|
| 98 | 98 | } |
| 99 | - //refer to https://us7.api.mailchimp.com/playground |
|
| 100 | - ]); |
|
| 99 | + //refer to https://us7.api.mailchimp.com/playground |
|
| 100 | + ]); |
|
| 101 | 101 | } catch (Exception $ex) { |
| 102 | 102 | $exe = json_decode($ex->getMessage(), true); |
| 103 | 103 | } |
@@ -42,24 +42,24 @@ discard block |
||
| 42 | 42 | $hash = md5($email); |
| 43 | 43 | $isPaidStatus = StatusSetting::select()->value('mailchimp_ispaid_status'); |
| 44 | 44 | $productStatusStatus = StatusSetting::select()->value('mailchimp_product_status'); |
| 45 | - if ($isPaidStatus ==1) { |
|
| 45 | + if ($isPaidStatus == 1) { |
|
| 46 | 46 | $interestGroupIdForNo = $this->relation->is_paid_no; //Interest GroupId for IsPaid Is No |
| 47 | 47 | $interestGroupIdForYes = $this->relation->is_paid_yes; //Interest GroupId for IsPaid Is Yes |
| 48 | 48 | } |
| 49 | - if ($productStatusStatus ==1) { |
|
| 49 | + if ($productStatusStatus == 1) { |
|
| 50 | 50 | $productGroupId = $this->groupRelation->where('agora_product_id', $productid) |
| 51 | 51 | ->pluck('mailchimp_group_cat_id')->first(); |
| 52 | 52 | } |
| 53 | - if ($interestGroupIdForNo && $productGroupId) { |
|
| 53 | + if ($interestGroupIdForNo && $productGroupId) { |
|
| 54 | 54 | $result = $this->mailchimp->patch("lists/$this->list_id/members/$hash", [ |
| 55 | 55 | 'interests' => [$interestGroupIdForNo => true, $interestGroupIdForYes=>false, $productGroupId =>true], |
| 56 | 56 | //refer to https://us7.api.mailchimp.com/playground |
| 57 | 57 | ]); |
| 58 | - } elseif ($interestGroupIdForNo && $productGroupId ==null) { |
|
| 58 | + } elseif ($interestGroupIdForNo && $productGroupId == null) { |
|
| 59 | 59 | $result = $this->mailchimp->patch("lists/$this->list_id/members/$hash", [ |
| 60 | 60 | 'interests' => [$interestGroupIdForNo => true, $interestGroupIdForYes=>false], |
| 61 | 61 | //refer to https://us7.api.mailchimp.com/playground |
| 62 | - } elseif ($productGroupId && $interestGroupIdForNo==null || $interestGroupIdForYes==null) { |
|
| 62 | + } elseif ($productGroupId && $interestGroupIdForNo == null || $interestGroupIdForYes == null) { |
|
| 63 | 63 | $result = $this->mailchimp->patch("lists/$this->list_id/members/$hash", [ |
| 64 | 64 | 'interests' => [$productGroupId =>true], |
| 65 | 65 | } |
@@ -75,11 +75,11 @@ discard block |
||
| 75 | 75 | $hash = md5($email); |
| 76 | 76 | $isPaidStatus = StatusSetting::select()->value('mailchimp_ispaid_status'); |
| 77 | 77 | $productStatusStatus = StatusSetting::select()->value('mailchimp_product_status'); |
| 78 | - if ($isPaidStatus ==1) { |
|
| 78 | + if ($isPaidStatus == 1) { |
|
| 79 | 79 | $interestGroupIdForNo = $this->relation->is_paid_no; //Interest GroupId for IsPaid Is No |
| 80 | 80 | $interestGroupIdForYes = $this->relation->is_paid_yes; //Interest GroupId for IsPaid Is Yes |
| 81 | 81 | } |
| 82 | - if ($productStatusStatus ==1) { |
|
| 82 | + if ($productStatusStatus == 1) { |
|
| 83 | 83 | $productGroupId = $this->groupRelation->where('agora_product_id', $productid) |
| 84 | 84 | ->pluck('mailchimp_group_cat_id')->first(); |
| 85 | 85 | } |
@@ -88,11 +88,11 @@ discard block |
||
| 88 | 88 | 'interests' => [$interestGroupIdForNo => false, $interestGroupIdForYes=>true, $productGroupId =>true], |
| 89 | 89 | //refer to https://us7.api.mailchimp.com/playground |
| 90 | 90 | ]); |
| 91 | - } elseif ($interestGroupIdForNo && $productGroupId ==null) { |
|
| 91 | + } elseif ($interestGroupIdForNo && $productGroupId == null) { |
|
| 92 | 92 | $result = $this->mailchimp->patch("lists/$this->list_id/members/$hash", [ |
| 93 | 93 | 'interests' => [$interestGroupIdForNo => false, $interestGroupIdForYes=>true], |
| 94 | 94 | //refer to https://us7.api.mailchimp.com/playground |
| 95 | - } elseif ($productGroupId && $interestGroupIdForNo==null || $interestGroupIdForYes==null) { |
|
| 95 | + } elseif ($productGroupId && $interestGroupIdForNo == null || $interestGroupIdForYes == null) { |
|
| 96 | 96 | $result = $this->mailchimp->patch("lists/$this->list_id/members/$hash", [ |
| 97 | 97 | 'interests' => [$productGroupId =>true], |
| 98 | 98 | } |
@@ -9,7 +9,7 @@ |
||
| 9 | 9 | class BaseMailChimpController extends Controller |
| 10 | 10 | { |
| 11 | 11 | public function getLists() |
| 12 | - { |
|
| 12 | + { |
|
| 13 | 13 | try { |
| 14 | 14 | $result = $this->mailchimp->request('lists'); |
| 15 | 15 | |
@@ -109,8 +109,8 @@ discard block |
||
| 109 | 109 | $this->addSubscription($order->id, $plan_id, $version, $product, $serial_key); |
| 110 | 110 | $this->sendOrderMail($user_id, $order->id, $item->id); |
| 111 | 111 | //Update Subscriber To Mailchimp |
| 112 | - $mailchimpStatus = StatusSetting::first()->value('mailchimp_status'); |
|
| 113 | - if($mailchimpStatus == 1) { |
|
| 112 | + $mailchimpStatus = StatusSetting::first()->value('mailchimp_status'); |
|
| 113 | + if($mailchimpStatus == 1) { |
|
| 114 | 114 | $mailchimp = new \App\Http\Controllers\Common\MailChimpController(); |
| 115 | 115 | $email = User::where('id', $user_id)->pluck('email')->first(); |
| 116 | 116 | if ($item->subtotal > 0) { |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | } else { |
| 119 | 119 | $r = $mailchimp->updateSubscriberForFreeProduct($email, $product); |
| 120 | 120 | } |
| 121 | - } |
|
| 121 | + } |
|
| 122 | 122 | } catch (\Exception $ex) { |
| 123 | 123 | Bugsnag::notifyException($ex); |
| 124 | 124 | app('log')->error($ex->getMessage()); |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | $data = $template->data; |
| 279 | 279 | $replace = [ |
| 280 | 280 | 'name' => $user->first_name.' '.$user->last_name, |
| 281 | - 'serialkeyurl' => $myaccounturl, |
|
| 281 | + 'serialkeyurl' => $myaccounturl, |
|
| 282 | 282 | 'downloadurl' => $downloadurl, |
| 283 | 283 | 'invoiceurl' => $invoiceurl, |
| 284 | 284 | 'product' => $product, |
@@ -110,7 +110,7 @@ |
||
| 110 | 110 | $this->sendOrderMail($user_id, $order->id, $item->id); |
| 111 | 111 | //Update Subscriber To Mailchimp |
| 112 | 112 | $mailchimpStatus = StatusSetting::first()->value('mailchimp_status'); |
| 113 | - if($mailchimpStatus == 1) { |
|
| 113 | + if ($mailchimpStatus == 1) { |
|
| 114 | 114 | $mailchimp = new \App\Http\Controllers\Common\MailChimpController(); |
| 115 | 115 | $email = User::where('id', $user_id)->pluck('email')->first(); |
| 116 | 116 | if ($item->subtotal > 0) { |
@@ -274,7 +274,7 @@ |
||
| 274 | 274 | $check_product_category = $this->product($invoiceid); |
| 275 | 275 | //Update Subscriber To Mailchimp |
| 276 | 276 | $mailchimpStatus = StatusSetting::first()->value('mailchimp_status'); |
| 277 | - if( $mailchimpStatus == 1) { |
|
| 277 | + if ($mailchimpStatus == 1) { |
|
| 278 | 278 | $mailchimp = new \App\Http\Controllers\Common\MailChimpController(); |
| 279 | 279 | $r = $mailchimp->updateSubscriberForFreeProduct(\Auth::user()->email, $check_product_category->id); |
| 280 | 280 | } |