parent
							
								
									c31636b66e
								
							
						
					
					
						commit
						e9b628cd3f
					
				| 
						 | 
					@ -20,7 +20,7 @@ type SmtpMail struct {
 | 
				
			||||||
	from       string
 | 
						from       string
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func AuthType(authType string) mail.AuthType {
 | 
					func authType(authType string) mail.AuthType {
 | 
				
			||||||
	switch strings.ToUpper(authType) {
 | 
						switch strings.ToUpper(authType) {
 | 
				
			||||||
	case "PLAIN":
 | 
						case "PLAIN":
 | 
				
			||||||
		return mail.AuthPlain
 | 
							return mail.AuthPlain
 | 
				
			||||||
| 
						 | 
					@ -31,7 +31,7 @@ func AuthType(authType string) mail.AuthType {
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func EncryptionType(encryptionType string) mail.Encryption {
 | 
					func encryptionType(encryptionType string) mail.Encryption {
 | 
				
			||||||
	switch strings.ToUpper(encryptionType) {
 | 
						switch strings.ToUpper(encryptionType) {
 | 
				
			||||||
	case "SSL":
 | 
						case "SSL":
 | 
				
			||||||
		return mail.EncryptionSSL
 | 
							return mail.EncryptionSSL
 | 
				
			||||||
| 
						 | 
					@ -45,7 +45,7 @@ func EncryptionType(encryptionType string) mail.Encryption {
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func NewSmtpMail(hostname string, port int, username string, password string, noTLSCheck bool, auth string, fromName, from string, encryption string) *SmtpMail {
 | 
					func NewSmtpMail(hostname string, port int, username string, password string, noTLSCheck bool, auth string, fromName, from string, encryption string) *SmtpMail {
 | 
				
			||||||
	ans := SmtpMail{hostname: hostname, port: port, username: username, password: password, noTLSCheck: noTLSCheck, fromName: fromName, from: from, authType: AuthType(auth), encryption: EncryptionType(encryption)}
 | 
						ans := SmtpMail{hostname: hostname, port: port, username: username, password: password, noTLSCheck: noTLSCheck, fromName: fromName, from: from, authType: authType(auth), encryption: encryptionType(encryption)}
 | 
				
			||||||
	return &ans
 | 
						return &ans
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -522,7 +522,6 @@ func EmailClient(db store.IStore) echo.HandlerFunc {
 | 
				
			||||||
			emailSetting.DefaultEmailContent,
 | 
								emailSetting.DefaultEmailContent,
 | 
				
			||||||
			attachments,
 | 
								attachments,
 | 
				
			||||||
		)
 | 
							)
 | 
				
			||||||
		fmt.Println("\n\n\n %s \n\n\n", err)
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if err != nil {
 | 
							if err != nil {
 | 
				
			||||||
			return c.JSON(http.StatusInternalServerError, jsonHTTPResponse{false, err.Error()})
 | 
								return c.JSON(http.StatusInternalServerError, jsonHTTPResponse{false, err.Error()})
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -70,7 +70,7 @@ Email Settings
 | 
				
			||||||
                                </div>
 | 
					                                </div>
 | 
				
			||||||
                                <div class="form-group" style="width: 48%; margin-left: 4%">
 | 
					                                <div class="form-group" style="width: 48%; margin-left: 4%">
 | 
				
			||||||
                                    <label for="smtp_password">SMTP Password</label>
 | 
					                                    <label for="smtp_password">SMTP Password</label>
 | 
				
			||||||
                                    <input type="text" class="form-control" id="smtp_password"
 | 
					                                    <input type="password" class="form-control" id="smtp_password"
 | 
				
			||||||
                                           name="smtp_password" placeholder="E.g. *******"
 | 
					                                           name="smtp_password" placeholder="E.g. *******"
 | 
				
			||||||
                                           value="{{ .emailSettings.SmtpPassword }}">
 | 
					                                           value="{{ .emailSettings.SmtpPassword }}">
 | 
				
			||||||
                                </div>
 | 
					                                </div>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue