Skip to content
Snippets Groups Projects
Commit eea49804 authored by FORESTIER Fabien's avatar FORESTIER Fabien
Browse files

Add the no-reply address as var env

parent 0c085a34
No related branches found
No related tags found
No related merge requests found
Pipeline #
...@@ -43,6 +43,7 @@ deploy_development: ...@@ -43,6 +43,7 @@ deploy_development:
- export RABBITMQ_LISTENING_PORT=5672 - export RABBITMQ_LISTENING_PORT=5672
- export RABBITMQ_GUI_PORT=15672 - export RABBITMQ_GUI_PORT=15672
- export MAIL_SUBJECT_PREFIX=alpha - export MAIL_SUBJECT_PREFIX=alpha
- export NO_REPLY_MAIL_ADDRESS=no-reply@erasme.org
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker-compose pull - docker-compose pull
- docker-compose --project-name service-email-${TAG} up -d --force-recreate - docker-compose --project-name service-email-${TAG} up -d --force-recreate
...@@ -60,6 +61,7 @@ deploy_staging: ...@@ -60,6 +61,7 @@ deploy_staging:
- export RABBITMQ_LISTENING_PORT=5673 - export RABBITMQ_LISTENING_PORT=5673
- export RABBITMQ_GUI_PORT=15673 - export RABBITMQ_GUI_PORT=15673
- export MAIL_SUBJECT_PREFIX=alpha - export MAIL_SUBJECT_PREFIX=alpha
- export NO_REPLY_MAIL_ADDRESS=no-reply@erasme.org
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- TAG=dev docker-compose pull - TAG=dev docker-compose pull
- docker tag $CI_REGISTRY/refonte-data/service-email:dev $CI_REGISTRY/refonte-data/service-email:${TAG} - docker tag $CI_REGISTRY/refonte-data/service-email:dev $CI_REGISTRY/refonte-data/service-email:${TAG}
... ...
......
...@@ -14,6 +14,7 @@ services: ...@@ -14,6 +14,7 @@ services:
- GROUP_HEADER=x-consumer-groups - GROUP_HEADER=x-consumer-groups
- EMAIL_WRITER_GROUP_NAME=email-writer - EMAIL_WRITER_GROUP_NAME=email-writer
- MAIL_SUBJECT_PREFIX=${MAIL_SUBJECT_PREFIX} - MAIL_SUBJECT_PREFIX=${MAIL_SUBJECT_PREFIX}
- NO_REPLY_MAIL_ADDRESS=${NO_REPLY_MAIL_ADDRESS}
restart: unless-stopped restart: unless-stopped
rabbitmq: rabbitmq:
... ...
......
...@@ -24,6 +24,7 @@ export class ConfigService { ...@@ -24,6 +24,7 @@ export class ConfigService {
this._config.groupNames.emailWriter = process.env.EMAIL_WRITER_GROUP_NAME; this._config.groupNames.emailWriter = process.env.EMAIL_WRITER_GROUP_NAME;
this._config.groupHeader = process.env.GROUP_HEADER; this._config.groupHeader = process.env.GROUP_HEADER;
this._config.mailSubjectPrefix = process.env.MAIL_SUBJECT_PREFIX; this._config.mailSubjectPrefix = process.env.MAIL_SUBJECT_PREFIX;
this._config.noReplyMailAddress = process.env.NO_REPLY_MAIL_ADDRESS;
} }
get config() { get config() {
... ...
......
...@@ -13,4 +13,5 @@ export const config = { ...@@ -13,4 +13,5 @@ export const config = {
}, },
groupHeader: '', groupHeader: '',
mailSubjectPrefix: '', mailSubjectPrefix: '',
noReplyMailAddress: '',
}; };
\ No newline at end of file
...@@ -2,3 +2,4 @@ RABBITMQ_USER= ...@@ -2,3 +2,4 @@ RABBITMQ_USER=
RABBITMQ_PASSWORD= RABBITMQ_PASSWORD=
USER_SUPPORT_MAILBOX= USER_SUPPORT_MAILBOX=
MAIL_SUBJECT_PREFIX= MAIL_SUBJECT_PREFIX=
NO_REPLY_MAIL_ADDRESS=
\ No newline at end of file
...@@ -43,6 +43,7 @@ export class EmailService { ...@@ -43,6 +43,7 @@ export class EmailService {
const userEmail = new EmailWithoutFrom(); const userEmail = new EmailWithoutFrom();
userEmail.to = [contactForm.email]; userEmail.to = [contactForm.email];
adminEmail.replyTo = this.config.userSupportMailbox;
userEmail.subject = contactForm.subject; userEmail.subject = contactForm.subject;
userEmail.html = userEmailBody; userEmail.html = userEmailBody;
...@@ -89,10 +90,10 @@ export class EmailService { ...@@ -89,10 +90,10 @@ export class EmailService {
const mailerQueue = this.config.mailerQueue; const mailerQueue = this.config.mailerQueue;
let email = new Email(); let email = new Email();
email.from = this.config.userSupportMailbox; email.from = this.config.noReplyMailAddress;
email = Object.assign(email, emailInfo); email = Object.assign(email, emailInfo);
if (this.config.emailSubjectPrefix) { if (this.config.mailSubjectPrefix) {
email.subject = `[${this.config.mailSubjectPrefix}] ${email.subject}`; email.subject = `[${this.config.mailSubjectPrefix}] ${email.subject}`;
} }
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment