[angular-16 | DONE | CHANGED]: Change email composer for Develop project (Add name, surname, email in mail body).

This commit is contained in:
Konstantinos Triantafyllou 2023-10-25 10:37:39 +03:00
parent b69e19fa17
commit 54bff7cd4a
1 changed files with 23 additions and 20 deletions

View File

@ -1,6 +1,7 @@
import {Email} from "./email";
import {Body} from "./body";
import {properties} from "../../../../environments/environment";
import {User} from "../../login/utils/helper.class";
export class Composer {
private static noteBodySize = "14px";
@ -93,11 +94,13 @@ export class Composer {
return email;
}
public static composeEmailForDevelop(contactForm: any, admins: any): Email {
public static composeEmailForDevelop(contactForm: any, admins: any, user: User): Email {
let email: Email = new Email();
email.subject = "OpenAIRE - Develop [" + properties.environment.toUpperCase() + "]";
email.body = "<div style='font-size:" + this.noteBodySize + "'>"
+ "<span><b>Name</b>: " + user.firstname + "</span><br>"
+ "<span><b>Surname</b>: " + user.lastname + "</span><br>"
+ "<span><b>Email</b>: " + user.email + "</span><br>"
+ "<span><b>Subject</b>: " + (contactForm.subject ? contactForm.subject : '-') + "</span><br>"
+ "<p>" + contactForm.message + "</p>"
+ "</div>";