mirror of
https://github.com/prurigro/hypothetical.git
synced 2024-11-09 11:16:39 -05:00
Only use laravel newsletter for subscriptions when the MAILCHIMP variables are filled out
This commit is contained in:
parent
12cbe5c404
commit
e89191027b
1 changed files with 8 additions and 6 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue