Merge branch 'add-no-subject-option' into 'main'
Add nosubject option See merge request etke.cc/postmoogle!6
This commit is contained in:
@@ -107,9 +107,11 @@ func (b *Bot) Send(ctx context.Context, from, to, subject, plaintext, html strin
|
|||||||
text.WriteString(from)
|
text.WriteString(from)
|
||||||
text.WriteString("\n\n")
|
text.WriteString("\n\n")
|
||||||
}
|
}
|
||||||
|
if !utils.Bool(settings.Get("nosubject")) {
|
||||||
text.WriteString("# ")
|
text.WriteString("# ")
|
||||||
text.WriteString(subject)
|
text.WriteString(subject)
|
||||||
text.WriteString("\n\n")
|
text.WriteString("\n\n")
|
||||||
|
}
|
||||||
if html != "" {
|
if html != "" {
|
||||||
text.WriteString(format.HTMLToMarkdown(html))
|
text.WriteString(format.HTMLToMarkdown(html))
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -23,12 +23,14 @@ var (
|
|||||||
"mailbox": "Get or set mailbox of that room",
|
"mailbox": "Get or set mailbox of that room",
|
||||||
"owner": "Get or set owner of that room",
|
"owner": "Get or set owner of that room",
|
||||||
"nosender": "Get or set `nosender` of that room (`true` - hide email sender; `false` - show email sender)",
|
"nosender": "Get or set `nosender` of that room (`true` - hide email sender; `false` - show email sender)",
|
||||||
|
"nosubject": "Get or set `nosubject` of that room (`true` - hide email subject; `false` - show email subject)",
|
||||||
}
|
}
|
||||||
|
|
||||||
// sanitizers is map of option name => sanitizer function
|
// sanitizers is map of option name => sanitizer function
|
||||||
sanitizers = map[string]sanitizerFunc{
|
sanitizers = map[string]sanitizerFunc{
|
||||||
"mailbox": utils.Mailbox,
|
"mailbox": utils.Mailbox,
|
||||||
"nosender": utils.SanitizeBoolString,
|
"nosender": utils.SanitizeBoolString,
|
||||||
|
"nosubject": utils.SanitizeBoolString,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user