mirror of
https://github.com/knadh/listmonk.git
synced 2025-10-07 22:06:23 +08:00
feat: Add from_email
to postback struct for sending tx postbacks (#1623)
This commit is contained in:
parent
e869f7b0a9
commit
be62c50b3c
2 changed files with 9 additions and 0 deletions
|
@ -17,6 +17,7 @@ import (
|
||||||
//easyjson:json
|
//easyjson:json
|
||||||
type postback struct {
|
type postback struct {
|
||||||
Subject string `json:"subject"`
|
Subject string `json:"subject"`
|
||||||
|
FromEmail string `json:"from_email"`
|
||||||
ContentType string `json:"content_type"`
|
ContentType string `json:"content_type"`
|
||||||
Body string `json:"body"`
|
Body string `json:"body"`
|
||||||
Recipients []recipient `json:"recipients"`
|
Recipients []recipient `json:"recipients"`
|
||||||
|
@ -96,6 +97,7 @@ func (p *Postback) Name() string {
|
||||||
func (p *Postback) Push(m models.Message) error {
|
func (p *Postback) Push(m models.Message) error {
|
||||||
pb := postback{
|
pb := postback{
|
||||||
Subject: m.Subject,
|
Subject: m.Subject,
|
||||||
|
FromEmail: m.From,
|
||||||
ContentType: m.ContentType,
|
ContentType: m.ContentType,
|
||||||
Body: string(m.Body),
|
Body: string(m.Body),
|
||||||
Recipients: []recipient{{
|
Recipients: []recipient{{
|
||||||
|
|
|
@ -40,6 +40,8 @@ func easyjsonDf11841fDecodeGithubComKnadhListmonkInternalMessengerPostback(in *j
|
||||||
switch key {
|
switch key {
|
||||||
case "subject":
|
case "subject":
|
||||||
out.Subject = string(in.String())
|
out.Subject = string(in.String())
|
||||||
|
case "from_email":
|
||||||
|
out.FromEmail = string(in.String())
|
||||||
case "content_type":
|
case "content_type":
|
||||||
out.ContentType = string(in.String())
|
out.ContentType = string(in.String())
|
||||||
case "body":
|
case "body":
|
||||||
|
@ -119,6 +121,11 @@ func easyjsonDf11841fEncodeGithubComKnadhListmonkInternalMessengerPostback(out *
|
||||||
out.RawString(prefix[1:])
|
out.RawString(prefix[1:])
|
||||||
out.String(string(in.Subject))
|
out.String(string(in.Subject))
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
const prefix string = ",\"from_email\":"
|
||||||
|
out.RawString(prefix)
|
||||||
|
out.String(string(in.FromEmail))
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"content_type\":"
|
const prefix string = ",\"content_type\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
|
|
Loading…
Add table
Reference in a new issue