Skip to content

High performance, self-hosted, newsletter and mailing list manager with a modern dashboard. Single binary app.

feat: Add `from_email` to postback struct for sending tx postbacks (#1623)

Joe Paulbe62c50b3c2f
diff --git a/internal/messenger/postback/postback.go b/internal/messenger/postback/postback.go
index 3cb6c798..c99ec742 100644
--- a/internal/messenger/postback/postback.go
+++ b/internal/messenger/postback/postback.go
@@ -17,6 +17,7 @@ import (
//easyjson:json
type postback struct {
Subject string `json:"subject"`
+ FromEmail string `json:"from_email"`
ContentType string `json:"content_type"`
Body string `json:"body"`
Recipients []recipient `json:"recipients"`
@@ -96,6 +97,7 @@ func (p *Postback) Name() string {
func (p *Postback) Push(m models.Message) error {
pb := postback{
Subject: m.Subject,
+ FromEmail: m.From,
ContentType: m.ContentType,
Body: string(m.Body),
Recipients: []recipient{{
diff --git a/internal/messenger/postback/postback_easyjson.go b/internal/messenger/postback/postback_easyjson.go
index 44c2b000..e40e37cf 100644
--- a/internal/messenger/postback/postback_easyjson.go
+++ b/internal/messenger/postback/postback_easyjson.go
@@ -40,6 +40,8 @@ func easyjsonDf11841fDecodeGithubComKnadhListmonkInternalMessengerPostback(in *j
switch key {
case "subject":
out.Subject = string(in.String())
+ case "from_email":
+ out.FromEmail = string(in.String())
case "content_type":
out.ContentType = string(in.String())
case "body":
@@ -119,6 +121,11 @@ func easyjsonDf11841fEncodeGithubComKnadhListmonkInternalMessengerPostback(out *
out.RawString(prefix[1:])
out.String(string(in.Subject))
}
+ {
+ const prefix string = ",\"from_email\":"
+ out.RawString(prefix)
+ out.String(string(in.FromEmail))
+ }
{
const prefix string = ",\"content_type\":"
out.RawString(prefix)