Commit eea49804 authored by FORESTIER Fabien's avatar FORESTIER Fabien
Browse files

Add the no-reply address as var env

parent 0c085a34
Pipeline #2464 passed with stages
in 29 seconds
......@@ -43,6 +43,7 @@ deploy_development:
- export RABBITMQ_LISTENING_PORT=5672
- export RABBITMQ_GUI_PORT=15672
- 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-compose pull
- docker-compose --project-name service-email-${TAG} up -d --force-recreate
......@@ -60,6 +61,7 @@ deploy_staging:
- export RABBITMQ_LISTENING_PORT=5673
- export RABBITMQ_GUI_PORT=15673
- 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
- TAG=dev docker-compose pull
- docker tag $CI_REGISTRY/refonte-data/service-email:dev $CI_REGISTRY/refonte-data/service-email:${TAG}
......
......@@ -14,6 +14,7 @@ services:
- GROUP_HEADER=x-consumer-groups
- EMAIL_WRITER_GROUP_NAME=email-writer
- MAIL_SUBJECT_PREFIX=${MAIL_SUBJECT_PREFIX}
- NO_REPLY_MAIL_ADDRESS=${NO_REPLY_MAIL_ADDRESS}
restart: unless-stopped
rabbitmq:
......
......@@ -24,6 +24,7 @@ export class ConfigService {
this._config.groupNames.emailWriter = process.env.EMAIL_WRITER_GROUP_NAME;
this._config.groupHeader = process.env.GROUP_HEADER;
this._config.mailSubjectPrefix = process.env.MAIL_SUBJECT_PREFIX;
this._config.noReplyMailAddress = process.env.NO_REPLY_MAIL_ADDRESS;
}
get config() {
......
......@@ -13,4 +13,5 @@ export const config = {
},
groupHeader: '',
mailSubjectPrefix: '',
noReplyMailAddress: '',
};
\ No newline at end of file
RABBITMQ_USER=
RABBITMQ_PASSWORD=
USER_SUPPORT_MAILBOX=
MAIL_SUBJECT_PREFIX=
\ No newline at end of file
MAIL_SUBJECT_PREFIX=
NO_REPLY_MAIL_ADDRESS=
\ No newline at end of file
......@@ -43,6 +43,7 @@ export class EmailService {
const userEmail = new EmailWithoutFrom();
userEmail.to = [contactForm.email];
adminEmail.replyTo = this.config.userSupportMailbox;
userEmail.subject = contactForm.subject;
userEmail.html = userEmailBody;
......@@ -89,10 +90,10 @@ export class EmailService {
const mailerQueue = this.config.mailerQueue;
let email = new Email();
email.from = this.config.userSupportMailbox;
email.from = this.config.noReplyMailAddress;
email = Object.assign(email, emailInfo);
if (this.config.emailSubjectPrefix) {
if (this.config.mailSubjectPrefix) {
email.subject = `[${this.config.mailSubjectPrefix}] ${email.subject}`;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment