Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
m4lab_tv1
User Account
Commits
0ac2db14
Commit
0ac2db14
authored
Apr 06, 2020
by
Wolfgang Knopki
Browse files
added contact page
parent
9c4fcec3
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
package-lock.json
View file @
0ac2db14
This diff is collapsed.
Click to expand it.
routes/routes-account.js
View file @
0ac2db14
...
...
@@ -527,5 +527,41 @@ module.exports = function (app, config, passport, i18n) {
}
})
})
app
.
get
(
'
/contact
'
,
function
(
req
,
res
)
{
res
.
render
(
lang
+
'
/account/contact
'
,
{
user
:
req
.
user
});
});
app
.
post
(
'
/contact
'
,
function
(
req
,
res
,
next
)
{
//methods.currentDate();
let
emailAddress
=
req
.
body
.
inputEmail
;
let
supportAddress
=
"
support-transfer@hft-stuttgart.de
"
;
let
inputName
=
req
.
body
.
name
;
let
inputContent
=
req
.
body
.
message
;
let
emailContent
=
"
Es wurde eine Anfrage an das Transferportal gestellt:
\n\n
NAME:
"
+
inputName
+
"
\n
NACHRICHT:
\n
"
+
inputContent
;
let
emailSubject
=
"
Ihre Anfrage an das Transferportal
"
;
async
.
waterfall
([
function
(
done
)
{
// send email
mailer
.
options
.
to
=
supportAddress
;
mailer
.
options
.
cc
=
emailAddress
;
mailer
.
options
.
subject
=
emailSubject
;
mailer
.
options
.
text
=
emailContent
;
mailer
.
transport
.
sendMail
(
mailer
.
options
,
function
(
err
)
{
done
(
err
,
'
done
'
);
});
}
],
function
(
err
)
{
if
(
err
)
{
req
.
flash
(
'
error
'
,
'
Ein Fehler ist aufgetreten. Bitte versuchen Sie es erneut.
'
);
}
else
{
req
.
flash
(
'
success
'
,
'
Vielen Dank für Ihre Anfrage. Wir melden uns baldmöglichst bei Ihnen. Eine Kopie Ihrer Anfrage wurde an
'
+
emailAddress
+
'
versandt.
'
);
}
//res.redirect('/forgotPwd'); // deployment
res
.
redirect
(
'
/account/contact
'
);
// localhost
});
});
};
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment