From da10fd5a6123b802a6bf10de374d88c14df56eb1 Mon Sep 17 00:00:00 2001
From: Chakib BENHABIB <cbenhabib@neogeo.fr>
Date: Tue, 5 Jan 2021 16:24:39 +0100
Subject: [PATCH] Feat/admin reply email to user

---
 src/legacy/legacy.model.ts   | 3 ++-
 src/legacy/legacy.service.ts | 5 ++++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/legacy/legacy.model.ts b/src/legacy/legacy.model.ts
index 48975cb..4949391 100644
--- a/src/legacy/legacy.model.ts
+++ b/src/legacy/legacy.model.ts
@@ -520,4 +520,5 @@ export class Email {
   to: string[];
   subject: string;
   html: string; // As html
-}
\ No newline at end of file
+  replyTo?: string; //optional
+}
diff --git a/src/legacy/legacy.service.ts b/src/legacy/legacy.service.ts
index 7412c41..9f90509 100644
--- a/src/legacy/legacy.service.ts
+++ b/src/legacy/legacy.service.ts
@@ -543,6 +543,7 @@ export class LegacyService {
       await Promise.all([
         this.sendEmail({
           html: adminEmail,
+          replyTo: token.email,
           to: [this.conf.userSupportMailbox],
           subject: 'Demande d’accès aux données',
         }),
@@ -643,6 +644,7 @@ export class LegacyService {
       await Promise.all([
         this.sendEmail({
           html: adminEmail,
+          replyTo: token.email,
           to: [this.conf.userSupportMailbox],
           subject: 'Demande de renouvellement d’accès aux données',
         }),
@@ -747,6 +749,7 @@ export class LegacyService {
       await Promise.all([
         this.sendEmail({
           html: adminEmail,
+          replyTo: token.email,
           to: [this.conf.userSupportMailbox],
           subject: 'Demande de suppression d’accès aux données',
         }),
@@ -834,4 +837,4 @@ export class LegacyService {
       handleError(error, new InternalServerErrorException('Couldn\'t send email.'));
     }
   }
-}
\ No newline at end of file
+}
-- 
GitLab