Small refinements
This commit is contained in:
@ -35,6 +35,13 @@
|
|||||||
<input name="email" type="email" placeholder="Email" required />
|
<input name="email" type="email" placeholder="Email" required />
|
||||||
<input name="department" type="text" placeholder="Abteilung" />
|
<input name="department" type="text" placeholder="Abteilung" />
|
||||||
<input name="year" type="text" placeholder="Jahrgang" />
|
<input name="year" type="text" placeholder="Jahrgang" />
|
||||||
|
<input
|
||||||
|
name="zusage"
|
||||||
|
id="zusage"
|
||||||
|
type="checkbox"
|
||||||
|
checked
|
||||||
|
style="display: none"
|
||||||
|
/>
|
||||||
<button type="submit">Absenden</button>
|
<button type="submit">Absenden</button>
|
||||||
</form>
|
</form>
|
||||||
<img src="logo.png" alt="HTL Logo" class="form-logo" />
|
<img src="logo.png" alt="HTL Logo" class="form-logo" />
|
||||||
@ -46,12 +53,19 @@
|
|||||||
<div class="form-box">
|
<div class="form-box">
|
||||||
<h3>Abgesagt</h3>
|
<h3>Abgesagt</h3>
|
||||||
<p>Um es zu Finalisieren füllen Sie bitte die Felder aus</p>
|
<p>Um es zu Finalisieren füllen Sie bitte die Felder aus</p>
|
||||||
<form>
|
<form method="post" action="/post">
|
||||||
<input type="text" placeholder="Vorname" required />
|
<input name="firstname" type="text" placeholder="Vorname" required />
|
||||||
<input type="text" placeholder="Nachname" required />
|
<input name="lastname" type="text" placeholder="Nachname" required />
|
||||||
<input type="email" placeholder="Email" required />
|
<input name="email" type="email" placeholder="Email" required />
|
||||||
<input type="text" placeholder="Abteilung" />
|
<input name="department" type="text" placeholder="Abteilung" />
|
||||||
<input type="text" placeholder="Jahrgang" />
|
<input name="year" type="text" placeholder="Jahrgang" />
|
||||||
|
<input
|
||||||
|
name="absage"
|
||||||
|
id="absage"
|
||||||
|
type="checkbox"
|
||||||
|
checked
|
||||||
|
style="display: none"
|
||||||
|
/>
|
||||||
<button type="submit">Absenden</button>
|
<button type="submit">Absenden</button>
|
||||||
</form>
|
</form>
|
||||||
<img src="logo.png" alt="HTL Logo" class="form-logo" />
|
<img src="logo.png" alt="HTL Logo" class="form-logo" />
|
||||||
|
|||||||
9
index.js
9
index.js
@ -1,5 +1,6 @@
|
|||||||
const dotenv = require("dotenv");
|
const dotenv = require("dotenv");
|
||||||
dotenv.config()
|
dotenv.config();
|
||||||
|
|
||||||
const express = require("express");
|
const express = require("express");
|
||||||
const bodyParser = require('body-parser');
|
const bodyParser = require('body-parser');
|
||||||
const nodemailer = require("nodemailer");
|
const nodemailer = require("nodemailer");
|
||||||
@ -18,12 +19,12 @@ const transporter = nodemailer.createTransport({
|
|||||||
const app = express();
|
const app = express();
|
||||||
const port = 3000;
|
const port = 3000;
|
||||||
|
|
||||||
app.use(express.static("assets"))
|
app.use(express.static("assets"));
|
||||||
app.use(bodyParser.urlencoded());
|
app.use(bodyParser.urlencoded({ extended: true }));
|
||||||
|
|
||||||
app.post("/post", (req, res) => {
|
app.post("/post", (req, res) => {
|
||||||
fs.writeFile(`./data/${req.body.firstname}-${req.body.lastname}.json`, JSON.stringify(req.body), (err) => {
|
fs.writeFile(`./data/${req.body.firstname}-${req.body.lastname}.json`, JSON.stringify(req.body), (err) => {
|
||||||
return res.send(err)
|
console.log(err)
|
||||||
})
|
})
|
||||||
|
|
||||||
transporter.sendMail({
|
transporter.sendMail({
|
||||||
|
|||||||
Reference in New Issue
Block a user