mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
feat(licenses): enhance Stripe webhook handling for license creation
- Added support for the "invoice.paid" event to create licenses upon successful payment. - Refactored the handling of subscription updates to improve license deactivation logic. - Removed the expiration date from the LicenseEmail component to simplify email content. - Improved error handling for customer retrieval and subscription status checks.
This commit is contained in:
@@ -18,7 +18,6 @@ interface LicenseEmailProps {
|
||||
customerName: string;
|
||||
licenseKey: string;
|
||||
productName: string;
|
||||
expirationDate: Date;
|
||||
features: string[];
|
||||
}
|
||||
|
||||
@@ -28,15 +27,8 @@ export const LicenseEmail = ({
|
||||
customerName = "John Doe",
|
||||
licenseKey = "1234567890",
|
||||
productName = "Dokploy",
|
||||
expirationDate = new Date(),
|
||||
features = ["Feature 1", "Feature 2", "Feature 3"],
|
||||
}: LicenseEmailProps): React.ReactElement => {
|
||||
const formattedDate = expirationDate.toLocaleDateString("en-US", {
|
||||
year: "numeric",
|
||||
month: "long",
|
||||
day: "numeric",
|
||||
});
|
||||
|
||||
return (
|
||||
<Html>
|
||||
<Head />
|
||||
@@ -69,12 +61,6 @@ export const LicenseEmail = ({
|
||||
<Text style={licenseKeyStyle}>{licenseKey}</Text>
|
||||
</Section>
|
||||
|
||||
<Section style={validitySection}>
|
||||
<Text style={validityText}>
|
||||
🗓️ Next billing date: <strong>{formattedDate}</strong>
|
||||
</Text>
|
||||
</Section>
|
||||
|
||||
<Section style={featuresContainer}>
|
||||
<Heading as="h2" style={h2}>
|
||||
🎉 Your Premium Features
|
||||
|
||||
Reference in New Issue
Block a user