t('Nextcloud Enterprise');?>

t('The enterprise-ready Content Collaboration Platform');?>

hint = $hint; parent::__construct($hint, $code, $previous); } public function getHint() { return $this->hint; } } try { // validation expected data exists and setting variables if(!isset($_POST['email'])) { throw new HintException('The submitted form was invalid and missed the email address.'); } if(!isset($_POST['firstname']) || $_POST['firstname'] !== '') { throw new HintException('The request is invalid. Please try again.'); } $twoDaysInSeconds = 2 * 24 * 60 * 60; if(!isset($_POST['requesttime']) || (int)$_POST['requesttime'] < $twoDaysInSeconds || (int)$_POST['requesttime'] > (time() - 8)) { // denies action when the time rendering the previous page and the // sending the request took more than 2 days, less then 8s or is // unknown throw new HintException('The request is invalid. Please try again.'); } if(!isset($_POST['segmentId']) && !is_numeric($_POST['segmentId'])) { throw new HintException('The submitted form was invalid.'); } $email_to = filter_var($_POST['email'], FILTER_SANITIZE_EMAIL); if(!filter_var($email_to, FILTER_VALIDATE_EMAIL)) { throw new HintException('The email address is invalid or missing.'); } $newsletter = (int)$_POST['moreinfo']; $whitepaper_nr = (int)$_POST['segmentId']; // turn $whitepapernr into $whitepaper_name and $whitepaper_url from a json file $storeVar = file_get_contents(__DIR__."/assets/whitepapers.json"); $storeArray = json_decode($storeVar, true); $whitepaper_name = $storeArray[$whitepaper_nr]['whitepaper_name']; $whitepaper_url = $storeArray[$whitepaper_nr]['whitepaper_url']; if($newsletter === 1) { subscribe($email_to); } // send email function clean_string($string) { $bad = array("content-type","bcc:","to:","cc:","href"); $string = str_replace($bad,"",$string); return htmlspecialchars($string); } $email_message = "Thank you for requesting a Nextcloud white paper or data sheet.\n\n"; $email_subject = "Nextcloud download: ".clean_string($whitepaper_name); $email_message .= "Download our ".clean_string($whitepaper_name)." here:\n"; $email_message .= $whitepaper_url."\n\n"; $email_from = "sales@nextcloud.com"; // add note that we added them to our newsletter (if they did tick the box) if($newsletter === 1) { $email_message .= "We have subscribed you to the Nextcloud newsletter, thank you for your interest!\n\n"; } $email_message .= "If you have any questions about the whitepaper or Nextcloud,\nplease contact our sales team by replying to this message or\nthrough our website.\n\n"; // create email headers $headers = "From: ".$email_from."\r\n". 'Reply-To: '.$email_from."\r\n" . 'Content-Type: text/plain; charset=UTF-8'."\r\n"; // store in log, to track how much and what is downloaded $data = [ // 'to' => $email_to, // we could enable this for debugging but it is otherwise not really useful so let's keep it off 'whitepaper' => $whitepaper_name, 'newsletter' => $newsletter, 'timestamp' => time(), // 'message' => $email_message, // 'headers' => $headers, ]; file_put_contents('/var/log/whitepapers.txt', json_encode($data) . PHP_EOL, FILE_APPEND | LOCK_EX); // Send the email @mail($email_to, $email_subject, $email_message, $headers); ?>

Thank you for requesting a white paper, case study or datasheet!

A link to download our paper has been sent to .

check your spam folder if you can't find it!

We have subscribed you to the Nextcloud newsletter, thank you for your interest!

Sorry, there was an error with the form you submitted.
The error(s) detected:

getHint()); ?>

Please use the back key to go to
the previous page and fix the issue, or
contact us with the error message.

get_class($exception), 'Message' => $exception->getMessage(), 'Code' => $exception->getCode(), 'Trace' => $exception->getTraceAsString(), 'File' => $exception->getFile(), 'Line' => $exception->getLine(), ); error_log(json_encode($data)); ?>

Apologies

There was a problem on our side

Please contact us and ask for the whitepaper or data sheet you tried to download.