mirror of
https://github.com/wneessen/go-mail.git
synced 2024-11-14 01:42:54 +01:00
Fix for X-Priority
This commit is contained in:
parent
06aff07a03
commit
8e31cf0133
2 changed files with 17 additions and 1 deletions
16
header.go
16
header.go
|
@ -106,6 +106,22 @@ func (i Importance) NumString() string {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// XPrioString returns the X-Priority number string based on the Importance
|
||||||
|
func (i Importance) XPrioString() string {
|
||||||
|
switch i {
|
||||||
|
case ImportanceNonUrgent:
|
||||||
|
return "5"
|
||||||
|
case ImportanceLow:
|
||||||
|
return "5"
|
||||||
|
case ImportanceHigh:
|
||||||
|
return "1"
|
||||||
|
case ImportanceUrgent:
|
||||||
|
return "1"
|
||||||
|
default:
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// String returns the importance string based on the Importance
|
// String returns the importance string based on the Importance
|
||||||
func (i Importance) String() string {
|
func (i Importance) String() string {
|
||||||
switch i {
|
switch i {
|
||||||
|
|
2
msg.go
2
msg.go
|
@ -308,7 +308,7 @@ func (m *Msg) SetImportance(i Importance) {
|
||||||
}
|
}
|
||||||
m.SetHeader(HeaderImportance, i.String())
|
m.SetHeader(HeaderImportance, i.String())
|
||||||
m.SetHeader(HeaderPriority, i.NumString())
|
m.SetHeader(HeaderPriority, i.NumString())
|
||||||
m.SetHeader(HeaderXPriority, i.NumString())
|
m.SetHeader(HeaderXPriority, i.XPrioString())
|
||||||
m.SetHeader(HeaderXMSMailPriority, i.NumString())
|
m.SetHeader(HeaderXMSMailPriority, i.NumString())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue