Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Albin Geraud Kouatcho Nkuigwa
PSE_Projekt
Commits
3effadcc
Commit
3effadcc
authored
Jun 19, 2018
by
Janik Münzenberger
Browse files
Add error display
parent
a2207644
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/app/components/email/email.component.html
View file @
3effadcc
<div
class=
"alert alert-success"
*ngIf=
"sent"
role=
"alert"
><i
class=
"fas fa-check"
></i>
{{"EMAIL.SUCCESS" | translate}}
</div>
<div
class=
"alert alert-success"
*ngIf=
"sent"
role=
"alert"
><i
class=
"fas fa-check mr-2"
></i>
{{"EMAIL.SUCCESS" | translate}}
</div>
<div
class=
"alert alert-danger"
*ngIf=
"!sent && error"
role=
"alert"
>
{{"EMAIL.FAILED" | translate}}
</div>
<form
[formGroup]=
"emailForm"
*ngIf=
"!sent"
>
<div
class=
"form-group row"
>
<label
for=
"email_sender"
class=
"col-sm-2 col-form-label"
>
{{"EMAIL.SENDER" | translate}}:
</label>
...
...
src/app/components/email/email.component.ts
View file @
3effadcc
...
...
@@ -16,6 +16,7 @@ export class EmailComponent implements OnInit {
@
Input
()
message
:
string
=
""
;
emailForm
:
FormGroup
;
sent
:
boolean
=
false
;
error
:
boolean
=
false
;
constructor
(
private
emailService
:
EmailService
,
private
userService
:
UserService
)
{
}
...
...
@@ -37,12 +38,15 @@ export class EmailComponent implements OnInit {
let
email
:
IEmail
=
{
sender
:
this
.
emailForm
.
get
(
'
email_sender
'
).
value
,
receiver
:
this
.
emailForm
.
get
(
'
email_receiver
'
).
value
,
subject
:
"
Email von PSE HDA app
"
,
subject
:
"
Krankheitsanalyse von
"
+
this
.
emailForm
.
get
(
'
email_sender
'
).
value
,
message
:
this
.
emailForm
.
get
(
'
email_message
'
).
value
+
"
\n\n
"
+
this
.
message
};
this
.
emailService
.
sendEmail
(
email
)
.
then
(
x
=>
this
.
sent
=
true
)
.
catch
(
err
=>
console
.
log
(
err
));
.
catch
(
err
=>
{
console
.
log
(
err
);
this
.
error
=
true
;
});
}
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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