Text changes with earnings
This commit is contained in:
@@ -67,7 +67,8 @@ class RentalFlowEmailService {
|
||||
|
||||
const variables = {
|
||||
ownerName: owner.firstName,
|
||||
renterName: `${renter.firstName} ${renter.lastName}`.trim() || "A renter",
|
||||
renterName:
|
||||
`${renter.firstName} ${renter.lastName}`.trim() || "A renter",
|
||||
itemName: rental.item?.name || "your item",
|
||||
startDate: rental.startDateTime
|
||||
? new Date(rental.startDateTime).toLocaleString("en-US", {
|
||||
@@ -227,15 +228,15 @@ class RentalFlowEmailService {
|
||||
<table class="info-table">
|
||||
<tr>
|
||||
<th>Total Rental Amount</th>
|
||||
<td>\\$${totalAmount.toFixed(2)}</td>
|
||||
<td>$${totalAmount.toFixed(2)}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Community Upkeep Fee (10%)</th>
|
||||
<td>-\\$${platformFee.toFixed(2)}</td>
|
||||
<td>-$${platformFee.toFixed(2)}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Your Payout</th>
|
||||
<td class="highlight">\\$${payoutAmount.toFixed(2)}</td>
|
||||
<td class="highlight">$${payoutAmount.toFixed(2)}</td>
|
||||
</tr>
|
||||
</table>
|
||||
`;
|
||||
@@ -248,7 +249,7 @@ class RentalFlowEmailService {
|
||||
stripeSection = `
|
||||
<div class="warning-box">
|
||||
<p><strong>⚠️ Action Required: Set Up Your Earnings Account</strong></p>
|
||||
<p>To receive your payout of <strong>\\$${payoutAmount.toFixed(
|
||||
<p>To receive your payout of <strong>$${payoutAmount.toFixed(
|
||||
2
|
||||
)}</strong> when this rental completes, you need to set up your earnings account.</p>
|
||||
</div>
|
||||
@@ -274,7 +275,7 @@ class RentalFlowEmailService {
|
||||
stripeSection = `
|
||||
<div class="success-box">
|
||||
<p><strong>✓ Earnings Account Active</strong></p>
|
||||
<p>Your earnings account is set up. You'll automatically receive \\$${payoutAmount.toFixed(
|
||||
<p>Your earnings account is set up. You'll automatically receive $${payoutAmount.toFixed(
|
||||
2
|
||||
)} when this rental completes.</p>
|
||||
<p><a href="${frontendUrl}/earnings" style="color: #155724; text-decoration: underline;">View your earnings dashboard →</a></p>
|
||||
@@ -323,7 +324,10 @@ class RentalFlowEmailService {
|
||||
htmlContent
|
||||
);
|
||||
} catch (error) {
|
||||
console.error("Failed to send rental approval confirmation email:", error);
|
||||
console.error(
|
||||
"Failed to send rental approval confirmation email:",
|
||||
error
|
||||
);
|
||||
return { success: false, error: error.message };
|
||||
}
|
||||
}
|
||||
@@ -1002,7 +1006,7 @@ class RentalFlowEmailService {
|
||||
error: emailError.message,
|
||||
stack: emailError.stack,
|
||||
renterEmail: renter.email,
|
||||
rentalId: rental.id
|
||||
rentalId: rental.id,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1021,15 +1025,15 @@ class RentalFlowEmailService {
|
||||
<table class="info-table">
|
||||
<tr>
|
||||
<th>Total Rental Amount</th>
|
||||
<td>\\$${totalAmount.toFixed(2)}</td>
|
||||
<td>$${totalAmount.toFixed(2)}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Community Upkeep Fee (10%)</th>
|
||||
<td>-\\$${platformFee.toFixed(2)}</td>
|
||||
<td>-$${platformFee.toFixed(2)}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Your Payout</th>
|
||||
<td class="highlight">\\$${payoutAmount.toFixed(2)}</td>
|
||||
<td class="highlight">$${payoutAmount.toFixed(2)}</td>
|
||||
</tr>
|
||||
</table>
|
||||
<p style="font-size: 14px; color: #6c757d;">
|
||||
@@ -1045,7 +1049,7 @@ class RentalFlowEmailService {
|
||||
stripeSection = `
|
||||
<div class="warning-box">
|
||||
<p><strong>⚠️ Action Required: Set Up Your Earnings Account</strong></p>
|
||||
<p>To receive your payout of <strong>\\$${payoutAmount.toFixed(
|
||||
<p>To receive your payout of <strong>$${payoutAmount.toFixed(
|
||||
2
|
||||
)}</strong>, you need to set up your earnings account.</p>
|
||||
</div>
|
||||
@@ -1071,7 +1075,7 @@ class RentalFlowEmailService {
|
||||
stripeSection = `
|
||||
<div class="success-box">
|
||||
<p><strong>✓ Payout Initiated</strong></p>
|
||||
<p>Your earnings of <strong>\\$${payoutAmount.toFixed(
|
||||
<p>Your earnings of <strong>$${payoutAmount.toFixed(
|
||||
2
|
||||
)}</strong> have been transferred to your Stripe account.</p>
|
||||
<p style="font-size: 14px; margin-top: 10px;">Funds typically reach your bank within 2-7 business days.</p>
|
||||
@@ -1122,14 +1126,14 @@ class RentalFlowEmailService {
|
||||
error: emailError.message,
|
||||
stack: emailError.stack,
|
||||
ownerEmail: owner.email,
|
||||
rentalId: rental.id
|
||||
rentalId: rental.id,
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
logger.error("Error sending rental completion emails", {
|
||||
error: error.message,
|
||||
stack: error.stack,
|
||||
rentalId: rental?.id
|
||||
rentalId: rental?.id,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user