From 8a2ebc48ea487a0af9ea36597820272065c227c3 Mon Sep 17 00:00:00 2001 From: Kevin MacMartin Date: Tue, 26 Sep 2017 16:02:53 -0400 Subject: [PATCH] Compare the mailchimp variables to null rather than an empty string, and assume the .env has the variables set to something --- .env.example | 4 ++-- app/Http/Controllers/SubscriptionController.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.env.example b/.env.example index 3fd682f..c8c57fd 100644 --- a/.env.example +++ b/.env.example @@ -37,7 +37,7 @@ MAIL_ENCRYPTION=tls MAIL_SENDFROM=null MAIL_SENDTO=null -MAILCHIMP_APIKEY= -MAILCHIMP_LISTID= +MAILCHIMP_APIKEY=null +MAILCHIMP_LISTID=null REGISTRATION=true diff --git a/app/Http/Controllers/SubscriptionController.php b/app/Http/Controllers/SubscriptionController.php index 0ada1e2..96e244f 100644 --- a/app/Http/Controllers/SubscriptionController.php +++ b/app/Http/Controllers/SubscriptionController.php @@ -18,7 +18,7 @@ class SubscriptionController extends Controller { $lname = preg_match('/. ./', $name) === 1 ? preg_replace('/^[^ ][^ ]* /', '', $name) : ''; $email = $request['email']; - if (env('MAILCHIMP_APIKEY', '') != '' && env('MAILCHIMP_LISTID', '') != '') { + if (env('MAILCHIMP_APIKEY') != null && env('MAILCHIMP_LISTID') != null) { // Submit the subscription request Newsletter::subscribeOrUpdate($email, [ 'FNAME' => $fname,