Skip to content

Commit

Permalink
Improving contact form interaction
Browse files Browse the repository at this point in the history
  • Loading branch information
FabioGabrielSager committed Mar 9, 2024
1 parent eb2ca14 commit 0abb870
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,21 @@ export class ContactFormComponent implements OnDestroy {
newEmail.subject = this.form.controls['subject'].value;
newEmail.text = this.form.controls['message'].value;

this.toastService.show("El mensaje se esta enviendo, esto puede tardar unos segundos",
"bg-info text-light");

this.subs.add(this.emailService.sendEmail(newEmail).subscribe(
{
next: value => { this.toastService.show("Mensaje enviado con éxito!", "bg-success text-light") },
next: value => {
this.toastService.show("Mensaje enviado con éxito!", "bg-success text-light");
this.form.reset();
},
error: err => { this.toastService.show("Hubo un error al intentar enviar el mensaje.",
"bg-danger text-light") }
}
))
));


}

ngOnDestroy(): void {
Expand Down

0 comments on commit 0abb870

Please sign in to comment.