-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move email config from .env to settings model (#71)
- Loading branch information
1 parent
b48fe59
commit 23e7d2b
Showing
7 changed files
with
160 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,12 @@ | ||
PUBLIC_URL="http://localhost:8080" | ||
API_KEY="alongsecurestring" | ||
|
||
POSTGRES_PASSWORD="password123" | ||
POSTGRES_USER="postgres" | ||
POSTGRES_DB="postgres" | ||
|
||
API_KEY= | ||
|
||
LOGO_URL="https://mathphys.info/mathphysinfo-logo.png" | ||
HOMEPAGE_URL="https://mathphys.info" | ||
COPYRIGHT="Copyright © 2024, Fachschaft MathPhysInfo. All rights reserved." | ||
|
||
PRIMARY_COLOR="#990000" | ||
|
||
SMTP_HOST= | ||
SMTP_USER= | ||
SMTP_PASSWORD= | ||
SMTP_PORT= | ||
FROM_ADDRESS= | ||
|
||
EMAIL_GREETING="Hey" | ||
EMAIL_SIGNATURE="Dein" | ||
EMAIL_NAME="Pepp - Die Vorkursverwaltung" | ||
|
||
EMAIL_CONFIRM_SUBJECT="Bitte bestätige deine E-Mail Adresse" | ||
EMAIL_CONFIRM_INTRO="danke für deine Registrierung als Vorkurstutor/-in!" | ||
EMAIL_CONFIRM_BUTTON_INSTRUCTION="Bitte klicke hier, um deine E-Mail Adresse und die Verfügbarkeiten zu bestätigen:" | ||
EMAIL_CONFIRM_BUTTON_TEXT="Bestätigen" | ||
EMAIL_CONFIRM_OUTRO="Wir melden uns bei dir." | ||
|
||
EMAIL_ASSIGNMENTS_SUBJECT="Deine Veranstaltung" | ||
EMAIL_ASSIGNMENTS_EVENT_TITLE="Veranstaltung" | ||
EMAIL_ASSIGNMENTS_KIND_TITLE="Art" | ||
EMAIL_ASSIGNMENTS_DATE_TITLE="Datum" | ||
EMAIL_ASSIGNMENTS_TIME_TITLE="Uhrzeit" | ||
EMAIL_ASSIGNMENTS_ROOM_TITLE="Raum" | ||
EMAIL_ASSIGNMENTS_BUILDING_TITLE="Gebäude" | ||
EMAIL_ASSIGNMENTS_INTRO="aufgrund deiner angegebenen Verfügbarkeiten, wurdest du der folgenden Veranstaltung zugewiesen:" | ||
EMAIL_ASSIGNMENTS_OUTRO="Sollte dir der Termin doch nicht passen, melde dich bitte zeitnah bei uns, indem du auf diese E-Mail reagierst. Wir freuen uns auf einen erfolgreichen Vorkurs mit dir!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package email | ||
|
||
import "github.com/matcornic/hermes/v2" | ||
|
||
type Config struct { | ||
LogoUrl string | ||
HomepageUrl string | ||
CopyrightNotice string | ||
Greeting string | ||
Signature string | ||
Name string | ||
|
||
Confirmation Email | ||
Assignment Email | ||
} | ||
|
||
func (c *Config) ApplySettings(s map[string]string) { | ||
c.LogoUrl = s["logo-url"] | ||
c.HomepageUrl = s["homepage-url"] | ||
c.CopyrightNotice = s["copyright-notice"] | ||
c.Greeting = s["email-greeting"] | ||
c.Signature = s["email-signature"] | ||
c.Name = s["email-name"] | ||
|
||
c.Confirmation.Subject = s["email-confirm-subject"] | ||
c.Confirmation.Intros = []string{s["email-confirm-intro"]} | ||
c.Confirmation.Outros = []string{s["email-confirm-outro"]} | ||
c.Confirmation.Actions = []hermes.Action{{ | ||
Instructions: s["email-confirm-button-instruction"], | ||
Button: hermes.Button{ | ||
Color: s["primary-color"], | ||
Text: s["email-confirm-button-text"], | ||
}, | ||
}} | ||
c.Confirmation.Table = hermes.Table{ | ||
Columns: hermes.Columns{ | ||
CustomWidth: map[string]string{ | ||
s["email-assignment-date-title"]: "20%", | ||
s["email-assignment-kind-title"]: "30%", | ||
}, | ||
}, | ||
} | ||
|
||
c.Assignment.Intros = []string{s["email-assignment-intro"]} | ||
c.Assignment.Outros = []string{s["email-assignment-outro"]} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters