From 530d11de994a2a9bde2970d2c346066d47c90dd5 Mon Sep 17 00:00:00 2001 From: cofrizot Date: Wed, 18 Oct 2023 16:25:01 +0200 Subject: [PATCH] Add the contact form --- src/app/app.module.ts | 5 ++++- src/app/form/form.component.html | 2 +- src/app/form/form.component.ts | 7 +++---- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 8fb6071..2c5f5ad 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -10,6 +10,8 @@ import { OutputComponent } from './output/output.component'; import { LandingPageComponent } from './landing-page/landing-page.component'; import { DocumentationComponent } from './documentation/documentation.component'; import { FormComponent } from './form/form.component'; +import { ReactiveFormsModule } from '@angular/forms'; + @NgModule({ @@ -25,7 +27,8 @@ import { FormComponent } from './form/form.component'; ], imports: [ BrowserModule, - AppRoutingModule + AppRoutingModule, + ReactiveFormsModule ], providers: [], bootstrap: [AppComponent] diff --git a/src/app/form/form.component.html b/src/app/form/form.component.html index 6197324..d71c382 100644 --- a/src/app/form/form.component.html +++ b/src/app/form/form.component.html @@ -24,7 +24,7 @@
- +
diff --git a/src/app/form/form.component.ts b/src/app/form/form.component.ts index 11d2b66..795f2c0 100644 --- a/src/app/form/form.component.ts +++ b/src/app/form/form.component.ts @@ -1,6 +1,5 @@ import { Component } from '@angular/core'; import { FormBuilder, FormGroup } from '@angular/forms'; -import { ReactiveFormsModule } from '@angular/forms'; import emailjs from '@emailjs/browser'; @@ -15,7 +14,7 @@ export class FormComponent { constructor(private fb: FormBuilder) { this.form = this.fb.group({ from_name: [''], - to_name: ['Sankasten'], + to_name: ['Sandkasten'], from_email: [''], subject: [''], message: [''] @@ -23,9 +22,9 @@ export class FormComponent { } async send() { - emailjs.init('user_your_user_id'); + emailjs.init('cLIr6GuwhkrH1JFio'); try { - let response = await emailjs.send("your_service_id", "your_template_id", { + let response = await emailjs.send("service_rvmwu94", "template_q0spe61", { from_name: this.form.value.from_name, to_name: this.form.value.to_name, message: this.form.value.message,