Skip to content

Commit e2a5509

Browse files
committed
postmark message id
1 parent 3a97fd0 commit e2a5509

2 files changed

Lines changed: 6 additions & 18 deletions

File tree

internal/service/postmark_service.go

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -545,14 +545,8 @@ func (s *PostmarkService) SendEmail(ctx context.Context, workspaceID string, mes
545545
"To": to,
546546
"Subject": subject,
547547
"HtmlBody": content,
548-
"Headers": []map[string]string{
549-
{
550-
"Name": "Message-ID",
551-
"Value": messageID,
552-
},
553-
{
554-
"X-PM-KeepID": "true",
555-
},
548+
"Metadata": map[string]string{
549+
"notifuse_message_id": messageID,
556550
},
557551
}
558552

internal/service/webhook_event_service.go

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -291,16 +291,10 @@ func (s *WebhookEventService) processPostmarkWebhook(integrationID string, rawPa
291291
var timestamp time.Time
292292
var notifuseMessageID string
293293

294-
// Check for custom Message-ID header in the Headers field
295-
if headersData, ok := jsonData["Headers"].([]interface{}); ok {
296-
for _, header := range headersData {
297-
if headerMap, ok := header.(map[string]interface{}); ok {
298-
if name, ok := headerMap["Name"].(string); ok && name == "Message-ID" {
299-
if value, ok := headerMap["Value"].(string); ok {
300-
notifuseMessageID = value
301-
}
302-
}
303-
}
294+
// Check for notifuse_message_id in metadata
295+
if payload.Metadata != nil {
296+
if msgID, ok := payload.Metadata["notifuse_message_id"]; ok {
297+
notifuseMessageID = msgID
304298
}
305299
}
306300

0 commit comments

Comments
 (0)