listSubscribe($mcListId, $email, $mergeFields, 'html', false); if ($success) { Session::set(Session::KEY_MAILCHIMP_LIST_IDS, array_merge(Session::get(Session::KEY_MAILCHIMP_LIST_IDS, []), [$mcListId])); Session::set(Session::KEY_LIST_SUB_SUCCESS, __('Great success! Welcome to LBRY.')); } else { $error = $mcApi->errorMessage ?: __('Something went wrong adding you to the list.'); Session::set('list_error', $error); } } Controller::redirect($nextUrl); } public static function prepareJoinList(array $vars) { $vars += ['btnClass' => 'btn-primary', 'returnUrl' => $_SERVER['REQUEST_URI']]; $vars['error'] = Session::get('list_error'); $vars['success'] = Session::get(Session::KEY_LIST_SUB_SUCCESS); Session::unsetKey('list_error'); Session::unsetKey(Session::KEY_LIST_SUB_SUCCESS); return $vars; } }