sanathp / statusok

Monitor your Website and APIs from your Computer. Get Notified through Slack, E-mail when your server is down or response time is more than expected.
Other
1.62k stars 197 forks source link

no subject #16

Open peylight opened 7 years ago

peylight commented 7 years ago

Hi emails have no any subject. can i add any subject instead of empty subject?

johannesE commented 6 years ago

I would love to have the server name in there. It would help a lot, especially if you are suddenly getting a ton of emails.

TwanoO67 commented 5 years ago

Same problem here, without subject the emails are considered as spam

TwanoO67 commented 4 years ago

According to this: https://golang.org/src/net/smtp/example_test.go

it could be as simple as adding a "Subject: ...." to the message string. https://github.com/sanathp/statusok/blob/master/notify/mail_notify.go#L74

I don't know the go language so cannot be sure of this but maybe, something like that, on line 74, would do the trick:

message := fmt.Sprintf("Subject: [StatusOk] Timeout on "+responseTimeNotification.Url+"\r\n" +"\r\n" + getMessageFromResponseTimeNotification(responseTimeNotification) )

Can someone test that ? @sanathp @johannesE @peylight

johannesE commented 4 years ago

@TwanoO67 Sorry, I am not using statusok anymore.