Merge pull request 'update info bid submitted mail' (#117) from main into staging

Reviewed-on: #117
This commit is contained in:
zelda 2026-02-10 18:15:49 +11:00
commit ff719c9dfc
1 changed files with 10 additions and 2 deletions

View File

@ -360,15 +360,23 @@ export class MailsService {
}
getBidSubmittedEmailContent(bid: Bid): string {
const histories = _.orderBy(bid.histories || [], ['price'], ['desc']);
const webname = extractDomain(bid.web_bid.origin_url);
const title = `[${webname}] ${bid.name || 'Unnamed Item'}`;
const endTime = formatEndTime(bid.close_time, false);
const competitor = `$${bid.current_price}`;
const max = `$${bid.max_price}`;
const submitted = `$${bid.max_price}`;
const maxReached = bid.max_price <= bid.max_price;
const submitted =
bid.max_price == histories[0]?.price
? `$${bid.max_price}`
: `$${histories[0]?.price}`;
const maxReached = bid.max_price == histories[0]?.price;
// const maxReached = bid.max_price <= bid.max_price;
const from = process.env.MAIL_USER || 'no-reply@example.com';
console.log({ histories, maxReached, submitted });
return `
<!DOCTYPE html>
<html lang="en">