Rename the email override field for clarity
This commit is contained in:
parent
2f19e6e1b8
commit
68a00c91db
|
@ -35,7 +35,8 @@ var Config = HMNConfig{
|
||||||
FromAddress: "noreply@example.com",
|
FromAddress: "noreply@example.com",
|
||||||
FromAddressPassword: "",
|
FromAddressPassword: "",
|
||||||
FromName: "Handmade Network Team",
|
FromName: "Handmade Network Team",
|
||||||
OverrideRecipientEmail: "override@handmade.network", // NOTE(asaf): If this is not empty, all emails will be redirected to this address.
|
|
||||||
|
ForceToAddress: "localdev@example.com", // NOTE(asaf): If this is not empty, all emails will be sent to this address.
|
||||||
},
|
},
|
||||||
DigitalOcean: DigitalOceanConfig{
|
DigitalOcean: DigitalOceanConfig{
|
||||||
AssetsSpacesKey: "dummy",
|
AssetsSpacesKey: "dummy",
|
||||||
|
|
|
@ -65,7 +65,7 @@ type EmailConfig struct {
|
||||||
FromAddress string
|
FromAddress string
|
||||||
FromAddressPassword string
|
FromAddressPassword string
|
||||||
FromName string
|
FromName string
|
||||||
OverrideRecipientEmail string
|
ForceToAddress string
|
||||||
}
|
}
|
||||||
|
|
||||||
type DiscordConfig struct {
|
type DiscordConfig struct {
|
||||||
|
|
|
@ -106,8 +106,8 @@ func renderTemplate(name string, data interface{}) (string, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func sendMail(toAddress, toName, subject, contentHtml string) error {
|
func sendMail(toAddress, toName, subject, contentHtml string) error {
|
||||||
if config.Config.Email.OverrideRecipientEmail != "" {
|
if config.Config.Email.ForceToAddress != "" {
|
||||||
toAddress = config.Config.Email.OverrideRecipientEmail
|
toAddress = config.Config.Email.ForceToAddress
|
||||||
}
|
}
|
||||||
contents := prepMailContents(
|
contents := prepMailContents(
|
||||||
makeHeaderAddress(toAddress, toName),
|
makeHeaderAddress(toAddress, toName),
|
||||||
|
|
Loading…
Reference in New Issue