send($data['newsletter'], $data['subscriber']); } catch(\Exception $e) { return $this->errorResponse(array( $e->getCode() => $e->getMessage() )); } if($result === false) { return $this->errorResponse(array( APIError::BAD_REQUEST => __("The email could not be sent. Please check your settings.") )); } else { return $this->successResponse(null); } } }