From ea15f7434c393543a0b8c7370a1d0af344372fbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Ekstr=C3=B6m?= Date: Mon, 1 Dec 2025 15:54:58 +0100 Subject: [PATCH] Revert "Update order email (#8173)" This reverts commit 6d2629428ce033aeed90684ae551f6bd068c5e7a. --- .../src/emails/notification_new_sale.tsx | 122 ++---------------- server/emails/src/types/openapi.ts | 80 +----------- server/polar/notifications/notification.py | 39 +----- server/polar/order/service.py | 33 +---- server/tests/notifications/test_email.py | 22 +--- ..._MaintainerNewProductSaleNotification.html | 2 +- 6 files changed, 18 insertions(+), 280 deletions(-) diff --git a/server/emails/src/emails/notification_new_sale.tsx b/server/emails/src/emails/notification_new_sale.tsx index c09deffcc7..692bb4adaf 100644 --- a/server/emails/src/emails/notification_new_sale.tsx +++ b/server/emails/src/emails/notification_new_sale.tsx @@ -1,136 +1,36 @@ -import { Hr, Img, Preview, Section, Text } from '@react-email/components' -import Button from '../components/Button' +import { Preview } from '@react-email/components' import Footer from '../components/Footer' +import IntroWithHi from '../components/IntroWithHi' import PolarHeader from '../components/PolarHeader' import Wrapper from '../components/Wrapper' import type { schemas } from '../types' export function NotificationNewSale({ - customer_email, customer_name, - billing_address_city, - billing_address_line1, formatted_price_amount, - formatted_billing_reason, - formatted_address_country, product_name, - product_image_url, - order_date, - order_url, + product_price_amount, + organization_name, }: schemas['MaintainerNewProductSaleNotificationPayload']) { - const displayName = customer_name || customer_email - - const formattedDate = new Date(order_date).toLocaleDateString('en-US', { - month: "long", - day: 'numeric', - }) - - const addressParts = [billing_address_line1, billing_address_city].filter( - Boolean, - ) - const formattedAddress = - addressParts.length > 0 ? addressParts.join(', ') : null - return ( - - {displayName} placed an order for {product_name} - + New {product_name} sale - -
- - {displayName} placed an order on {formattedDate}! - -
- -
- -
- -
- -
- - Order Summary - - - - - {product_image_url && ( - - )} - - - -
- - - - {product_name} - - - {formatted_price_amount} - -
-
- -
- -
- - Order Type - - - {formatted_billing_reason} - -
- -
- - Customer - - {displayName} - {customer_email} - {formattedAddress && ( - {formattedAddress} - )} - {formatted_address_country && ( - - {formatted_address_country} - - )} -
- + + {customer_name} purchased {product_name} for{' '} + {formatted_price_amount}. +