Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
web-et-numerique
web-et-numerique-internet
data.grandlyon.com
web-portal
components
services
mailer
Commits
0c085a34
Commit
0c085a34
authored
Mar 26, 2019
by
FORESTIER Fabien
Browse files
Add prefix to email subject
parent
65b4046d
Pipeline
#2465
passed with stages
in 2 minutes and 44 seconds
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
0c085a34
...
...
@@ -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}
...
...
docker-compose.yml
View file @
0c085a34
...
...
@@ -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
:
...
...
src/configuration/config.service.ts
View file @
0c085a34
...
...
@@ -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
()
{
...
...
src/configuration/config.ts
View file @
0c085a34
...
...
@@ -12,4 +12,5 @@ export const config = {
emailWriter
:
''
,
},
groupHeader
:
''
,
mailSubjectPrefix
:
''
,
};
\ No newline at end of file
src/configuration/template.env
View file @
0c085a34
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
src/email/email.service.ts
View file @
0c085a34
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment