From 0554c9820ccdeb09b849c969218906ea5e1773f1 Mon Sep 17 00:00:00 2001 From: Axel Paris Date: Mon, 1 Apr 2019 18:44:28 +0200 Subject: [PATCH] Update SubscribeController.php Fix error 'email_type' from MailChimp --- src/controllers/SubscribeController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controllers/SubscribeController.php b/src/controllers/SubscribeController.php index 8d83820..59cee25 100644 --- a/src/controllers/SubscribeController.php +++ b/src/controllers/SubscribeController.php @@ -40,7 +40,7 @@ public function actionIndex() // Set params $params = [ 'email_address' => $request->post('email_address'), - 'email_type' => $request->post('email_type', ''), + 'email_type' => empty($request->post('email_type', '')) ? $request->post('email_type', '') : 'text', 'status' => $request->getRequiredBodyParam('status') ? Craft::$app->security->validateData($request->post('status')) : 'pending', 'merge_fields' => $request->post('merge_fields', (object)[]), 'interests' => $request->post('interests', (object)[]),