Skip to content

Commit 3a97fd0

Browse files
committed
keep postmark id
1 parent 629471f commit 3a97fd0

2 files changed

Lines changed: 9 additions & 6 deletions

File tree

console/src/pages/TransactionalNotificationsPage.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -377,11 +377,12 @@ export function TransactionalNotificationsPage() {
377377
"id": "${currentApiNotification.id}",
378378
"channels": ["email"],
379379
"contact": {
380-
"email": "recipient@example.com"
381-
// other optional contact fields here
380+
"email": "recipient@example.com",
381+
"first_name": "John",
382+
"last_name": "Doe"
382383
},
383384
"data": {
384-
// Your template variables here
385+
"your_template_variable": "value"
385386
},
386387
"email_options": {
387388
"reply_to": "reply@example.com",

internal/service/postmark_service.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"encoding/json"
77
"fmt"
88
"io"
9-
"log"
109
"net/http"
1110
"strconv"
1211
"strings"
@@ -75,7 +74,7 @@ func (s *PostmarkService) RegisterWebhook(ctx context.Context, config domain.Pos
7574
return nil, fmt.Errorf("failed to marshal webhook configuration: %w", err)
7675
}
7776

78-
log.Printf("Request: %+v", string(jsonData))
77+
// log.Printf("Request: %+v", string(jsonData))
7978

8079
req, err := http.NewRequestWithContext(ctx, http.MethodPost, "https://api.postmarkapp.com/webhooks", bytes.NewBuffer(jsonData))
8180
if err != nil {
@@ -96,7 +95,7 @@ func (s *PostmarkService) RegisterWebhook(ctx context.Context, config domain.Pos
9695

9796
if resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusCreated {
9897
body, _ := io.ReadAll(resp.Body)
99-
log.Printf("Response: %+v", string(body))
98+
// log.Printf("Response: %+v", string(body))
10099
s.logger.Error(fmt.Sprintf("Postmark API returned non-OK status code %d: %s", resp.StatusCode, string(body)))
101100
return nil, fmt.Errorf("API returned non-OK status code %d", resp.StatusCode)
102101
}
@@ -551,6 +550,9 @@ func (s *PostmarkService) SendEmail(ctx context.Context, workspaceID string, mes
551550
"Name": "Message-ID",
552551
"Value": messageID,
553552
},
553+
{
554+
"X-PM-KeepID": "true",
555+
},
554556
},
555557
}
556558

0 commit comments

Comments
 (0)