1
0
Fork 0
mirror of https://github.com/prurigro/hypothetical.git synced 2025-04-12 16:50:18 -04:00

Only use laravel newsletter for subscriptions when the MAILCHIMP variables are filled out

This commit is contained in:
Kevin MacMartin 2017-09-26 15:03:23 -04:00
parent 12cbe5c404
commit e89191027b

View file

@ -20,12 +20,14 @@ class SubscriptionController extends Controller {
$email = $request['email'];
$address = $request['address'];
// Submit the subscription request
Newsletter::subscribe($email, [
'FNAME' => $fname,
'LNAME' => $lname,
'ADDRESS' => $address
]);
if (env('MAILCHIMP_APIKEY', '') != '' && env('MAILCHIMP_LISTID', '') != '') {
// Submit the subscription request
Newsletter::subscribe($email, [
'FNAME' => $fname,
'LNAME' => $lname,
'ADDRESS' => $address
]);
}
// Save to the database on success
$subscriptions = new Subscriptions;