2024-08-20 10:59:50 +02:00
|
|
|
// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-3.0
|
|
|
|
|
|
|
|
/*
|
2024-09-06 10:34:25 +02:00
|
|
|
* interstellar_development website
|
|
|
|
* Copyright (C) 2024 interstellar_development
|
2024-08-20 10:59:50 +02:00
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Affero General Public License as
|
|
|
|
* published by the Free Software Foundation, either version 3 of the
|
|
|
|
* License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Affero General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Affero General Public License
|
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2024-08-20 10:40:56 +02:00
|
|
|
// contact-form.js
|
|
|
|
|
|
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
|
|
const contactForm = document.getElementById('contactForm');
|
|
|
|
|
|
|
|
if (contactForm) {
|
|
|
|
contactForm.addEventListener('submit', function(event) {
|
|
|
|
event.preventDefault(); // Prevent the form from submitting the traditional way
|
|
|
|
|
|
|
|
// Generate a random ticket number
|
|
|
|
const ticketNumber = Math.floor(Math.random() * 1000000); // Generates a random number between 0 and 999999
|
|
|
|
|
|
|
|
// Retrieve form values
|
|
|
|
const name = encodeURIComponent(document.getElementById('name').value);
|
|
|
|
const email = encodeURIComponent(document.getElementById('email').value);
|
|
|
|
const message = encodeURIComponent(document.getElementById('message').value);
|
|
|
|
|
|
|
|
// Construct the mailto link
|
|
|
|
const subject = `Support Ticket #${ticketNumber}`;
|
|
|
|
const body = `Name: ${name}%0AEmail: ${email}%0AMessage:%0A${message}`;
|
2024-08-30 09:59:14 +02:00
|
|
|
const mailtoLink = `mailto:example@example.com?subject=${subject}&body=${body}`;
|
2024-08-20 10:40:56 +02:00
|
|
|
|
|
|
|
// Open the default mail client
|
|
|
|
window.location.href = mailtoLink;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
2024-08-20 11:08:35 +02:00
|
|
|
|
|
|
|
// @license-end
|