[Trunk|Connect]: 1. Send an email and recaptcha token with email service's contact method
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-connect-portal/trunk@55275 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
11af7eed0f
commit
f41a893d0f
|
@ -5,5 +5,5 @@ export class ContactForm {
|
|||
affiliation: string = '';
|
||||
community: string = '';
|
||||
message: string = '';
|
||||
recaptcha: boolean = false;
|
||||
recaptcha: string = null;
|
||||
}
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
<div class="uk-container uk-container-large">
|
||||
<div uk-grid>
|
||||
<div class="uk-width-1-2@m uk-width-1-1@s">
|
||||
<h4 class="uk-margin-autouk-h4 uk-text-bold">Contact us and create your community profile</h4>
|
||||
<div class="uk-margin uk-padding uk-padding-remove-left" uk-grid>
|
||||
<h4 class="uk-margin-auto uk-h4 uk-text-bold">Contact us and create your community profile</h4>
|
||||
<div class="uk-margin uk-padding-small uk-padding-remove-left" uk-grid>
|
||||
<label class="uk-width-1-2 uk-h5 uk-text-bold">
|
||||
Name <span class="uk-text-danger uk-text-bold">*</span>
|
||||
</label>
|
||||
|
@ -68,7 +68,7 @@
|
|||
</div>
|
||||
<div class="uk-width-1-2@m uk-width-1-1@s">
|
||||
<h5 class="uk-margin-auto-top uk-margin-remove-bottom uk-h5 uk-text-bold">OpenAIRE gives you the virtual environment and services designed for your community to:</h5>
|
||||
<ul class="uk-list uk-list-divider uk-padding uk-margin-auto-top">
|
||||
<ul class="uk-list uk-list-divider uk-padding-small uk-padding-remove-left uk-margin-auto-top">
|
||||
<li><h5 class="uk-h5"><b>Create</b> and <b>Manage</b> your community</h5></li>
|
||||
<li><h5 class="uk-h5"><b>Access, share </b>and<b> link</b> together all your research</h5></li>
|
||||
<li><h5 class="uk-h5"><b>Monitor</b> and <b>report</b> your community's progress</h5></li>
|
||||
|
|
|
@ -19,19 +19,15 @@ export class ContactComponent implements OnInit {
|
|||
|
||||
public showLoading = true;
|
||||
public errorMessage = '';
|
||||
public updateErrorMessage = '';
|
||||
|
||||
public successfulSaveMessage = '';
|
||||
public successfulResetMessage = '';
|
||||
|
||||
public isSubmitted = false;
|
||||
public email: Email;
|
||||
public emailToInform: Email;
|
||||
public note = '';
|
||||
public properties: EnvProperties = null;
|
||||
|
||||
public contactForm: ContactForm = new ContactForm();
|
||||
public recaptchaToken: string = null;
|
||||
@ViewChild('name') name;
|
||||
@ViewChild('surname') surname;
|
||||
@ViewChild('sender') sender;
|
||||
|
@ -51,7 +47,6 @@ export class ContactComponent implements OnInit {
|
|||
this.route.data.subscribe((data: { envSpecific: EnvProperties }) => {
|
||||
this.properties = data.envSpecific;
|
||||
this.email = {body: '', subject: '', recipients: []};
|
||||
this.emailToInform = {body: '', subject: '', recipients: []};
|
||||
this.scroll();
|
||||
this.showLoading = false;
|
||||
});
|
||||
|
@ -77,8 +72,8 @@ export class ContactComponent implements OnInit {
|
|||
}
|
||||
|
||||
private sendMail(admins: any) {
|
||||
this._emailService.sendEmail(this.properties.adminToolsAPIURL + '/sendMail/',
|
||||
Composer.composeEmailForNewCommunity(this.contactForm, admins)).subscribe(
|
||||
this._emailService.contact(this.properties.adminToolsAPIURL + '/contact/',
|
||||
Composer.composeEmailForNewCommunity(this.contactForm, admins), this.contactForm.recaptcha).subscribe(
|
||||
res => {
|
||||
console.log(res)
|
||||
},
|
||||
|
@ -88,10 +83,7 @@ export class ContactComponent implements OnInit {
|
|||
|
||||
|
||||
public handleRecaptcha(captchaResponse: string) {
|
||||
this.recaptchaToken = captchaResponse;
|
||||
if(this.recaptchaToken) {
|
||||
this.contactForm.recaptcha = true;
|
||||
}
|
||||
this.contactForm.recaptcha = captchaResponse;
|
||||
}
|
||||
|
||||
|
||||
|
@ -102,9 +94,4 @@ export class ContactComponent implements OnInit {
|
|||
this.showLoading = false;
|
||||
}
|
||||
|
||||
handleSuccessfulSend(message) {
|
||||
this.showLoading = false;
|
||||
this.successfulSaveMessage = message;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue