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
3f59154c
Commit
3f59154c
authored
Jun 16, 2018
by
Janik Münzenberger
Browse files
FixedEmail sending
parent
3384b8f5
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/app/components/email/email.component.html
View file @
3f59154c
<form
[formGroup]=
"emailForm"
>
<div
class=
"alert alert-success"
*ngIf=
"sent"
role=
"alert"
><i
class=
"fas fa-check"
></i>
{{"EMAIL.SUCCESS" | 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>
<div
class=
"col-sm-10"
>
<input
type=
"email"
class=
"form-control"
formControlName=
"email_sender"
id=
"email_sender"
placeholder=
"Sender email"
required
>
<input
type=
"email"
autocomplete=
"email"
class=
"form-control"
formControlName=
"email_sender"
id=
"email_sender"
placeholder=
"Sender email"
required
>
</div>
</div>
<div
class=
"form-group row"
>
<label
for=
"email_receiver"
class=
"col-sm-2 col-form-label"
>
{{"EMAIL.RECEIVER" | translate}}:
</label>
<div
class=
"col-sm-10"
>
<select
*ngIf=
"receivers"
type=
"email"
class=
"form-control"
formControlName=
"email_receiver"
id=
"email_receiver"
placeholder=
"Receiver email"
required
>
<select
*ngIf=
"receivers"
type=
"email"
autocomplete=
"email"
class=
"form-control"
formControlName=
"email_receiver"
id=
"email_receiver"
placeholder=
"Receiver email"
required
>
<option
*ngFor=
"let recv of receivers"
[value]=
"recv.email"
>
{{recv.name}}
</option>
</select>
<input
*ngIf=
"!receivers || receivers.length == 0"
type=
"email"
class=
"form-control"
formControlName=
"email_receiver"
id=
"email_receiver"
placeholder=
"Receiver email"
>
<input
*ngIf=
"!receivers || receivers.length == 0"
type=
"email"
autocomplete=
"email"
class=
"form-control"
formControlName=
"email_receiver"
id=
"email_receiver"
placeholder=
"Receiver email"
>
</div>
</div>
<div
class=
"form-group row"
>
...
...
src/app/components/email/email.component.ts
View file @
3f59154c
...
...
@@ -15,6 +15,8 @@ export class EmailComponent implements OnInit {
@
Input
()
receivers
:
{
email
:
string
,
name
:
string
}[];
@
Input
()
message
:
string
=
""
;
emailForm
:
FormGroup
;
sent
:
boolean
=
false
;
constructor
(
private
emailService
:
EmailService
,
private
userService
:
UserService
)
{
}
...
...
@@ -35,10 +37,11 @@ export class EmailComponent implements OnInit {
let
email
:
IEmail
=
{
sender
:
this
.
emailForm
.
get
(
'
email_sender
'
).
value
,
receiver
:
this
.
emailForm
.
get
(
'
email_receiver
'
).
value
,
text
:
this
.
emailForm
.
get
(
'
email_message
'
).
value
+
"
\n\n
"
+
this
.
message
subject
:
"
Email von PSE HDA app
"
,
message
:
this
.
emailForm
.
get
(
'
email_message
'
).
value
+
"
\n\n
"
+
this
.
message
};
this
.
emailService
.
sendEmail
(
email
)
.
then
(
x
=>
console
.
log
(
"
sucessfully sent
"
)
)
.
then
(
x
=>
this
.
sent
=
true
)
.
catch
(
err
=>
console
.
log
(
err
));
}
}
...
...
src/app/model/IEmail.ts
View file @
3f59154c
...
...
@@ -2,5 +2,5 @@ export interface IEmail {
sender
:
string
,
receiver
:
string
,
subject
?:
string
,
text
:
string
message
:
string
}
\ No newline at end of file
src/app/pages/result/result.component.css
View file @
3f59154c
...
...
@@ -5,4 +5,12 @@
.modal-dialog
{
width
:
100%
;
max-width
:
85%
;
}
button
{
height
:
auto
;
word-break
:
normal
;
white-space
:
normal
;
max-width
:
100%
;
}
\ No newline at end of file
src/assets/i18n/de.json
View file @
3f59154c
...
...
@@ -66,7 +66,9 @@
"SENDER"
:
"Sender"
,
"RECEIVER"
:
"Empfänger"
,
"MESSAGE"
:
"Nachricht"
,
"ATTACHMENT"
:
"Anhang"
"ATTACHMENT"
:
"Anhang"
,
"SUCCESS"
:
"Email wurde erfolgreich versendet!"
,
"FAILED"
:
"Email konnte nicht versendet werden!"
},
"RESULT"
:
{
"FOR"
:
"Ergebnis für"
,
...
...
src/assets/i18n/en.json
View file @
3f59154c
...
...
@@ -66,7 +66,9 @@
"SENDER"
:
"Sender"
,
"RECEIVER"
:
"Receiver"
,
"MESSAGE"
:
"Message"
,
"ATTACHMENT"
:
"Attachment"
"ATTACHMENT"
:
"Attachment"
,
"SUCCESS"
:
"Successfully sent your email!"
,
"FAILED"
:
"Failed to send your email!"
},
"RESULT"
:
{
"FOR"
:
"Result for"
,
...
...
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