Rename the email override field for clarity #26

Merged
bvisness merged 1 commits from rename-email-override into master 2022-05-26 12:54:58 +00:00
3 changed files with 15 additions and 14 deletions

View File

@ -35,7 +35,8 @@ var Config = HMNConfig{
FromAddress: "noreply@example.com",
FromAddressPassword: "",
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{
AssetsSpacesKey: "dummy",

View File

@ -65,7 +65,7 @@ type EmailConfig struct {
FromAddress string
FromAddressPassword string
FromName string
OverrideRecipientEmail string
ForceToAddress string
}
type DiscordConfig struct {

View File

@ -106,8 +106,8 @@ func renderTemplate(name string, data interface{}) (string, error) {
}
func sendMail(toAddress, toName, subject, contentHtml string) error {
if config.Config.Email.OverrideRecipientEmail != "" {
toAddress = config.Config.Email.OverrideRecipientEmail
if config.Config.Email.ForceToAddress != "" {
toAddress = config.Config.Email.ForceToAddress
}
contents := prepMailContents(
makeHeaderAddress(toAddress, toName),