Skip to content

Commit 1393274

Browse files
committed
log mail payload size
1 parent a7dd390 commit 1393274

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

public/iframetest.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@
2222
</style>
2323
</head>
2424
<body>
25-
<iframe src="http://localhost:3000/v2?embedded=true" title="Example Website"></iframe>
25+
<iframe src="http://localhost:3000/sandbox?embedded=true&promptId=6de10fe4-5f20-407b-af9d-b0ea9279f9fe" width="100%" height="500px"></iframe>
2626
</body>
2727
</html>

src/server/util/pate.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { PATE_URL, API_TOKEN } from './config'
22
import { inDevelopment } from '../../config'
3+
import logger from './logger'
34

45
const settings = {
56
hideToska: false,
@@ -22,6 +23,12 @@ const sendEmail = async (targets: string[], text: string, subject: string) => {
2223
settings,
2324
}
2425

26+
const payload = JSON.stringify(mail)
27+
28+
const payloadSizeKb = Buffer.byteLength(payload, 'utf8') / 1024
29+
30+
logger.info(`Sending email with payload size ${payloadSizeKb.toFixed(2)} KB`)
31+
2532
await fetch(`${PATE_URL}?token=${API_TOKEN}`, {
2633
method: 'POST',
2734
headers: {

0 commit comments

Comments
 (0)