Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
5fca4c73
Commit
5fca4c73
authored
Feb 15, 2017
by
Daniel Lee
Committed by
GitHub
Feb 15, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7569 from jacobbednarz/add-sender-name-to-email
Updates mailer to include `from_name` value
parents
8b25ba6a
6a924750
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
12 additions
and
2 deletions
+12
-2
conf/defaults.ini
+1
-0
conf/sample.ini
+1
-0
docs/sources/http_api/admin.md
+1
-0
docs/sources/installation/configuration.md
+3
-0
pkg/services/notifications/mailer.go
+1
-1
pkg/services/notifications/notifications.go
+1
-1
pkg/services/notifications/notifications_test.go
+1
-0
pkg/services/notifications/send_email_integration_test.go
+1
-0
pkg/setting/setting_smtp.go
+2
-0
No files found.
conf/defaults.ini
View file @
5fca4c73
...
...
@@ -296,6 +296,7 @@ cert_file =
key_file
=
skip_verify
=
false
from_address
=
admin@grafana.localhost
from_name
=
Grafana Admin
[emails]
welcome_email_on_sign_up
=
false
...
...
conf/sample.ini
View file @
5fca4c73
...
...
@@ -282,6 +282,7 @@
;key_file =
;skip_verify = false
;from_address = admin@grafana.localhost
;from_name = Grafana Admin
[emails]
;welcome_email_on_sign_up = false
...
...
docs/sources/http_api/admin.md
View file @
5fca4c73
...
...
@@ -158,6 +158,7 @@ with Grafana admin permission.
"cert_file":"",
"enabled":"false",
"from_address":"admin@grafana.localhost",
"from_name":"Grafana Admin",
"host":"localhost:25",
"key_file":"",
"password":"************",
...
...
docs/sources/installation/configuration.md
View file @
5fca4c73
...
...
@@ -542,6 +542,9 @@ Verify SSL for smtp server? defaults to `false`
### from_address
Address used when sending out emails, defaults to
`admin@grafana.localhost`
### from_name
Name to be used when sending out emails, defaults to
`Grafana Admin`
## [log]
### mode
...
...
pkg/services/notifications/mailer.go
View file @
5fca4c73
...
...
@@ -150,7 +150,7 @@ func buildEmailMessage(cmd *m.SendEmailCommand) (*Message, error) {
return
&
Message
{
To
:
cmd
.
To
,
From
:
setting
.
Smtp
.
FromAddress
,
From
:
fmt
.
Sprintf
(
"%s <%s>"
,
setting
.
Smtp
.
FromName
,
setting
.
Smtp
.
FromAddress
)
,
Subject
:
subject
,
Body
:
buffer
.
String
(),
EmbededFiles
:
cmd
.
EmbededFiles
,
...
...
pkg/services/notifications/notifications.go
View file @
5fca4c73
...
...
@@ -48,7 +48,7 @@ func Init() error {
}
if
!
util
.
IsEmail
(
setting
.
Smtp
.
FromAddress
)
{
return
errors
.
New
(
"Invalid email address for
smpt from_a
dress config"
)
return
errors
.
New
(
"Invalid email address for
SMTP from_ad
dress config"
)
}
if
setting
.
EmailCodeValidMinutes
==
0
{
...
...
pkg/services/notifications/notifications_test.go
View file @
5fca4c73
...
...
@@ -23,6 +23,7 @@ func TestNotifications(t *testing.T) {
setting
.
Smtp
.
Enabled
=
true
setting
.
Smtp
.
TemplatesPattern
=
"emails/*.html"
setting
.
Smtp
.
FromAddress
=
"from@address.com"
setting
.
Smtp
.
FromName
=
"Grafana Admin"
err
:=
Init
()
So
(
err
,
ShouldBeNil
)
...
...
pkg/services/notifications/send_email_integration_test.go
View file @
5fca4c73
...
...
@@ -18,6 +18,7 @@ func TestEmailIntegrationTest(t *testing.T) {
setting
.
Smtp
.
Enabled
=
true
setting
.
Smtp
.
TemplatesPattern
=
"emails/*.html"
setting
.
Smtp
.
FromAddress
=
"from@address.com"
setting
.
Smtp
.
FromName
=
"Grafana Admin"
setting
.
BuildVersion
=
"4.0.0"
err
:=
Init
()
...
...
pkg/setting/setting_smtp.go
View file @
5fca4c73
...
...
@@ -8,6 +8,7 @@ type SmtpSettings struct {
CertFile
string
KeyFile
string
FromAddress
string
FromName
string
SkipVerify
bool
SendWelcomeEmailOnSignUp
bool
...
...
@@ -23,6 +24,7 @@ func readSmtpSettings() {
Smtp
.
CertFile
=
sec
.
Key
(
"cert_file"
)
.
String
()
Smtp
.
KeyFile
=
sec
.
Key
(
"key_file"
)
.
String
()
Smtp
.
FromAddress
=
sec
.
Key
(
"from_address"
)
.
String
()
Smtp
.
FromName
=
sec
.
Key
(
"from_name"
)
.
String
()
Smtp
.
SkipVerify
=
sec
.
Key
(
"skip_verify"
)
.
MustBool
(
false
)
emails
:=
Cfg
.
Section
(
"emails"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment