value variable not sent to my email #75
Replies: 1 comment
-
You have to edit your code to make it readable... <input type="hidden" name="packChoice" [ngModel]="packChoice" /> |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I'm sending you this message because I don't understand why in my form there are 3 variables out of 6 that are transferred...
when I console.log in the function that sends the variables, they exist but it doesn't want to send anything.
i'm on angular 15.2.
Thanks in advance for your help
HTML
`
`
TS
`import { Component, OnInit, ViewChild } from '@angular/core';
import { NgForm } from '@angular/forms';
import emailjs, { EmailJSResponseStatus } from '@emailjs/browser';
import { MessageService } from 'primeng/api';
@component({
selector: 'app-register-form',
templateUrl: './register-form.component.html',
styleUrls: ['./register-form.component.scss'],
providers: [MessageService]
})
export class RegisterFormComponent implements OnInit{
@ViewChild('registerForm')
registerForm!: NgForm;
isFormValid: boolean = false;
firstname: string = "";
lastname: string = "";
company: string = "";
salesteam: string = "";
integrationDate!: Date;
packChoice: string = "";
companyList: any[] = [{name: "Agentys"}, {name:"Weelodge"}]
packList: string[] = [
"Pack Gala SOLO",
"Pack Gala DUO (accompagnant hors réseau)",
"Pack Gala + Séminaire chambre SOLO",
"Pack Gala + Séminaire chambre DUO",
"Pack Gala DUO + Séminaire chambre SOLO",
"Pack Gala DUO + Séminaire chambre DUO"
]
salesteamList: string[] = ["Andrésy","Conflans Ste Honorine", "Eragny", "Jouy Le Moutier", "Poissy", "Achères", "Triel sur Seine", "Weelodge Center", "Osny", "La Varenne", "Le Perreux sur Marne", "Le Plessis Trevise", "St Maur des Fosses - Adamville", "St Maur des Fosses - Mairie", "St Maur des Fosses - Vieux St Maur", "Tours", "Villiers sur Marne", "Champigny sur Marne", "Nogent sur Marne", "Paris 12"]
selectedCompanyIsValid: boolean = false;
constructor(private messageService: MessageService) {
}
ngOnInit() {
}
onDropdownChange(event:any) {
if (this.firstname && this.lastname && this.company && this.integrationDate) {
}
public sendEmail(e: Event) {
e.preventDefault();
console.log('Company:', this.company);
console.log('Salesteam:', this.salesteam);
console.log('Pack Choice:', this.packChoice);
emailjs.sendForm('service_', 'template_', e.target as HTMLFormElement, 'user')
.then((result: EmailJSResponseStatus) => {
}
}
`
Beta Was this translation helpful? Give feedback.
All reactions