Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
getraenkekasse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Aaron Dötsch
getraenkekasse
Commits
6698107d
Commit
6698107d
authored
1 year ago
by
Aaron Dötsch
Browse files
Options
Downloads
Patches
Plain Diff
Add MAIL_SUBJECT_PREFIX env variable
parent
d26473c5
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
.env.example
+1
-0
1 addition, 0 deletions
.env.example
docker-compose.yml.example
+1
-0
1 addition, 0 deletions
docker-compose.yml.example
src/lib/server/mail.js
+2
-1
2 additions, 1 deletion
src/lib/server/mail.js
with
4 additions
and
1 deletion
.env.example
+
1
−
0
View file @
6698107d
...
...
@@ -11,3 +11,4 @@ MAIL_FROM_NAME="Getränkekasse"
MAIL_TLS=true
MAIL_AUTH_METHOD="plain"
MAIL_REPLY_TO="getraenke@domain.tld" # optional, sets the reply-to header, useful if you don't read the mailbox of MAIL_USER
MAIL_SUBJECT_PREFIX="[Getränkekasse] "
This diff is collapsed.
Click to expand it.
docker-compose.yml.example
+
1
−
0
View file @
6698107d
...
...
@@ -38,6 +38,7 @@ services:
MAIL_TLS: ${MAIL_TLS}
MAIL_AUTH_METHOD: ${MAIL_AUTH_METHOD}
MAIL_REPLY_TO: ${MAIL_REPLY_TO}
MAIL_SUBJECT_PREFIX: ${MAIL_SUBJECT_PREFIX}
volumes:
- ./article-images:/app/article-images
...
...
This diff is collapsed.
Click to expand it.
src/lib/server/mail.js
+
2
−
1
View file @
6698107d
...
...
@@ -21,8 +21,9 @@ const transporter = nodemailer.createTransport({
*/
export
async
function
sendMail
({
to
,
subject
,
text
,
html
=
false
})
{
const
content
=
html
?
{
html
:
text
}
:
{
text
};
const
subjectPrefix
=
process
.
env
.
MAIL_SUBJECT_PREFIX
??
""
;
return
transporter
.
sendMail
({
subject
,
subject
:
subjectPrefix
+
subject
,
to
,
from
:
{
address
:
process
.
env
.
MAIL_FROM_ADDRESS
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment