Skip to content

BillionMail gives you open-source MailServer, NewsLetter, Email Marketing — fully self-hosted, dev-friendly, and free from monthly fees. Join the discord: https://discord.gg/asfXzBUhZr

Generate HTML code every time the email is modified

hwliange5de7907c772
diff --git a/core/internal/service/askai/openai.go b/core/internal/service/askai/openai.go
index 49f33ee8..f1952858 100644
--- a/core/internal/service/askai/openai.go
+++ b/core/internal/service/askai/openai.go
@@ -458,9 +458,9 @@ func (o *OpenAI) GetMessages() []openai.ChatCompletionMessage {
historyMessages := o.ReadMessages() // Read messages from the chat history
lastContent, _ := GetHtml(o.ChatId)
o.IsModify = false
- if len(historyMessages) > 0 && lastContent != "" {
- o.IsModify = true // If there are history messages and last content is not empty, set IsModify to true
- }
+ // if len(historyMessages) > 0 && lastContent != "" {
+ // o.IsModify = true // If there are history messages and last content is not empty, set IsModify to true
+ // }
messages := []openai.ChatCompletionMessage{
{Role: openai.ChatMessageRoleSystem, Content: o.GetSystemPrompt()},
@@ -759,11 +759,6 @@ func (o *OpenAI) SetHtmlContent(content string, isText bool) (reasoning string,
}
}
- // isModify is true, it means the user is modifying the chat
- // if o.IsModify {
-
- // }
-
// If the content is a thinking block, append it to the Reasoning
if o.IsThinking {
o.Reasoning += content