sendmail: use EMAIL_SUBJECT variable for subject
Signed-off-by: Nicolas Froger <nicolas@kektus.xyz>
This commit is contained in:
		
							parent
							
								
									d56d8a8f2c
								
							
						
					
					
						commit
						980ec79dba
					
				
							
								
								
									
										2
									
								
								main.go
								
								
								
								
							
							
						
						
									
										2
									
								
								main.go
								
								
								
								
							| 
						 | 
					@ -74,7 +74,7 @@ func main() {
 | 
				
			||||||
	viper.SetDefault("SMTP_CLIENT_PASSWORD", "")
 | 
						viper.SetDefault("SMTP_CLIENT_PASSWORD", "")
 | 
				
			||||||
	viper.SetDefault("CONTACT_REPLY_EMAIL", "noreply@company.com")
 | 
						viper.SetDefault("CONTACT_REPLY_EMAIL", "noreply@company.com")
 | 
				
			||||||
	viper.SetDefault("CONTACT_REPLY_BCC_EMAIL", "contact@company.com")
 | 
						viper.SetDefault("CONTACT_REPLY_BCC_EMAIL", "contact@company.com")
 | 
				
			||||||
	viper.SetDefault("EMAIL_SUBJECT", "Thanks to try our product")
 | 
						viper.SetDefault("EMAIL_SUBJECT", "New message from contact form")
 | 
				
			||||||
	viper.SetDefault("SMTP_AUTHENTICATION_ENABLED", true)
 | 
						viper.SetDefault("SMTP_AUTHENTICATION_ENABLED", true)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	host := os.Getenv("HOST")
 | 
						host := os.Getenv("HOST")
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -257,7 +257,7 @@ func SendMail(httpResp http.ResponseWriter, httpReq *http.Request) {
 | 
				
			||||||
	sendMailReq := NewSendMailRequest(
 | 
						sendMailReq := NewSendMailRequest(
 | 
				
			||||||
		contactEmail,
 | 
							contactEmail,
 | 
				
			||||||
		recipients,
 | 
							recipients,
 | 
				
			||||||
		contactRequest.Subject,
 | 
							viper.GetString("EMAIL_SUBJECT"),
 | 
				
			||||||
	)
 | 
						)
 | 
				
			||||||
	err := sendMailReq.ParseTemplate(replyTplFile, templateData)
 | 
						err := sendMailReq.ParseTemplate(replyTplFile, templateData)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Reference in New Issue