Commit 0c085a34 authored by FORESTIER Fabien's avatar FORESTIER Fabien
Browse files

Add prefix to email subject

parent 65b4046d
Pipeline #2465 passed with stages
in 2 minutes and 44 seconds
......@@ -42,6 +42,7 @@ deploy_development:
- export MAIL_SERVICE_BIND_PORT=3001
- export RABBITMQ_LISTENING_PORT=5672
- export RABBITMQ_GUI_PORT=15672
- export MAIL_SUBJECT_PREFIX=alpha
- 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
......@@ -58,6 +59,7 @@ deploy_staging:
- export MAIL_SERVICE_BIND_PORT=3101
- export RABBITMQ_LISTENING_PORT=5673
- export RABBITMQ_GUI_PORT=15673
- export MAIL_SUBJECT_PREFIX=alpha
- 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}
......
......@@ -13,6 +13,7 @@ services:
- RABBITMQ_PASSWORD=${RABBITMQ_PASSWORD}
- GROUP_HEADER=x-consumer-groups
- EMAIL_WRITER_GROUP_NAME=email-writer
- MAIL_SUBJECT_PREFIX=${MAIL_SUBJECT_PREFIX}
restart: unless-stopped
rabbitmq:
......
......@@ -23,6 +23,7 @@ export class ConfigService {
this._config.userSupportMailbox = process.env.USER_SUPPORT_MAILBOX;
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;
}
get config() {
......
......@@ -12,4 +12,5 @@ export const config = {
emailWriter: '',
},
groupHeader: '',
mailSubjectPrefix: '',
};
\ No newline at end of file
RABBITMQ_USER=
RABBITMQ_PASSWORD=
USER_SUPPORT_MAILBOX=
\ No newline at end of file
USER_SUPPORT_MAILBOX=
MAIL_SUBJECT_PREFIX=
\ No newline at end of file
......@@ -92,8 +92,11 @@ export class EmailService {
email.from = this.config.userSupportMailbox;
email = Object.assign(email, emailInfo);
if (this.config.emailSubjectPrefix) {
email.subject = `[${this.config.mailSubjectPrefix}] ${email.subject}`;
}
Logger.log('[-] send method');
Logger.log(this.config);
Logger.log(email);
// Connect to rabbitmq
......
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