Compare the mailchimp variables to null rather than an empty string, and assume the .env has the variables set to something

This commit is contained in:
Kevin MacMartin 2017-09-26 16:02:53 -04:00
parent 0c2d78fae1
commit 8a2ebc48ea
2 changed files with 3 additions and 3 deletions

View file

@ -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

View file

@ -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,