[Library | Trunk]: Feedback email added. User will received an email about his report status.
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@58305 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
38d44d484d
commit
ec517e5614
|
@ -43,7 +43,7 @@ export class FeedbackComponent implements OnInit, OnChanges {
|
|||
public error: boolean = false;
|
||||
public form: FormGroup;
|
||||
public url: string = null;
|
||||
public recipients: string[] = ['kostis30fylloy@gmail.com'];
|
||||
public recipients: string[] = [];
|
||||
|
||||
constructor(private fb: FormBuilder,
|
||||
private emailService: EmailService) {
|
||||
|
@ -60,6 +60,7 @@ export class FeedbackComponent implements OnInit, OnChanges {
|
|||
} else if(this.dataProviderInfo) {
|
||||
this.title = this.dataProviderInfo.title.name;
|
||||
}
|
||||
this.recipients = [this.properties.feedbackmail];
|
||||
this.init();
|
||||
}
|
||||
|
||||
|
@ -114,6 +115,14 @@ export class FeedbackComponent implements OnInit, OnChanges {
|
|||
this.emailService.contact(this.properties.adminToolsAPIURL + '/contact', Composer.composeEmailForFeedback(this.form.value, this.recipients)).subscribe(sent => {
|
||||
this.error = !sent;
|
||||
if(sent) {
|
||||
if(this.form.get('email').value !== '') {
|
||||
this.emailService.contact(this.properties.adminToolsAPIURL + '/contact',
|
||||
Composer.composeEmailForUserAfterFeedback([this.form.get('email').value])).subscribe(sent => {
|
||||
if(sent) {
|
||||
//console.log('An email has been sent to user ' + this.form.get('email').value);
|
||||
}
|
||||
})
|
||||
}
|
||||
this.init();
|
||||
this.sent = true;
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ import {Project} from "../../utils/result-preview/result-preview";
|
|||
<li>
|
||||
<span class="uk-text-muted">Funded by: </span>
|
||||
<span *ngFor="let item of fundedByProjects.slice(0, showNum) let i=index">
|
||||
<a class="cursor-default">
|
||||
<a>
|
||||
<mark *ngIf="item.inline">
|
||||
<span *ngIf="item['funderShortname'] || item['funderName']">{{item['funderShortname']?item['funderShortname']:item['funderName']}}</span>
|
||||
<span *ngIf="!item['funderShortname'] && !item['funderName']">[no funder available]</span>
|
||||
|
|
|
@ -16,8 +16,8 @@ import {AlertModal} from "../modal/alert";
|
|||
[class.uk-text-small]="small">
|
||||
{{author.fullName}}
|
||||
</span>
|
||||
<a *ngIf="author.orcid && (properties.environment != 'production') && testBrowser"
|
||||
class="cursor-default"> <img src="assets/common-assets/common/ORCIDiD_icon16x16.png" alt="">{{" "}}
|
||||
<a *ngIf="author.orcid && (properties.environment != 'production') && testBrowser">
|
||||
<img src="assets/common-assets/common/ORCIDiD_icon16x16.png" alt="">{{" "}}
|
||||
<span [class.uk-text-small]="small">
|
||||
{{author.fullName}}
|
||||
</span>
|
||||
|
|
|
@ -65,7 +65,7 @@ export class Composer {
|
|||
return email;
|
||||
}
|
||||
|
||||
public static composeEmailForFeedback(info: {name: string, url: string, email: string, issues: any[],}, recipients: string[]): Email {
|
||||
public static composeEmailForFeedback(info: {name: string, url: string, email: string, issues: any[]}, recipients: string[]): Email {
|
||||
let email: Email = new Email();
|
||||
email.subject = 'Feedback report for ' + info.name;
|
||||
email.body = "<div style='font-size:" + this.noteBodySize + "'>"
|
||||
|
@ -79,6 +79,17 @@ export class Composer {
|
|||
return email;
|
||||
}
|
||||
|
||||
public static composeEmailForUserAfterFeedback(recipients: string[]): Email {
|
||||
let email: Email = new Email();
|
||||
email.subject = 'Feedback report received';
|
||||
email.body = "<div style='font-size:" + this.noteBodySize + "'>"
|
||||
+ "<p>This is an automated message to let you know that your feedback has been successfully received. Our graph experts will get back to you as soon as possible.</p><br>"
|
||||
+ "Thank you for contacting OpenAIRE."
|
||||
+ "</div>";
|
||||
email.recipients = recipients;
|
||||
return email;
|
||||
}
|
||||
|
||||
public static composeEmailToInformOldManagersForTheNewOnes(communityName: string, communityId: string, firstVersionOfManagers: any, managers: any) : Email {
|
||||
let email: Email = new Email();
|
||||
|
||||
|
|
Loading…
Reference in New Issue