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

This commit is contained in:
Joe Paul 2023-12-11 21:53:30 +05:30 committed by GitHub
parent e869f7b0a9
commit be62c50b3c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View file

@ -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{{

View file

@ -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)