emailer.go
Function SendEmail
has 64 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func SendEmail(outgoingEmail Outgoing) bool {
email_html, err := ioutil.ReadFile(configs.EmailsDir + outgoingEmail.Template)
from := mail.Address{configs.SMTPname, configs.SMTPfrom}
to := mail.Address{"", outgoingEmail.Email}
subj := outgoingEmail.Subject
Function SendEmail
has 9 return statements (exceeds 4 allowed). Open
Open
func SendEmail(outgoingEmail Outgoing) bool {
email_html, err := ioutil.ReadFile(configs.EmailsDir + outgoingEmail.Template)
from := mail.Address{configs.SMTPname, configs.SMTPfrom}
to := mail.Address{"", outgoingEmail.Email}
subj := outgoingEmail.Subject
Your code does not pass gofmt in 2 places. Go fmt your code! Open
Open
package SimpleMailer
- Exclude checks
comment on exported function ReplaceContentText should be of the form "ReplaceContentText ..." Open
Open
// function to replace variables as: {{USERNAME}} to USERNAME
- Exclude checks
don't use MixedCaps in package name; SimpleMailer should be simplemailer Open
Open
package SimpleMailer
- Exclude checks
don't use underscores in Go names; var email_html should be emailHTML Open
Open
email_html, err := ioutil.ReadFile(configs.EmailsDir + outgoingEmail.Template)
- Exclude checks
comment on exported function SendEmail should be of the form "SendEmail ..." Open
Open
// function to send an email with TLS and PlainAuth
- Exclude checks