Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into 29/Align-ApplicationS…
Browse files Browse the repository at this point in the history
…tatus
  • Loading branch information
KrissDrawing committed Oct 9, 2023
2 parents 4310dd9 + c2762ee commit bf5f117
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 2 deletions.
33 changes: 33 additions & 0 deletions backend/core/src/email/email.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,39 @@ export class EmailService {
)
}

public async listingOpportunity(user: User, appUrl: string) {
const jurisdiction = await this.getUserJurisdiction(user)
void (await this.loadTranslations(jurisdiction, user.language))
const compiledTemplate = this.template("listing-opportunity")

if (this.configService.get<string>("NODE_ENV") == "production") {
Logger.log(
`Preparing to send a listing opportunity email to ${user.email} from ${jurisdiction.emailFromAddress}...`
)
}

// TODO: This is mock data just for the template that will need to be updated
await this.send(
user.email,
jurisdiction.emailFromAddress,
"New rental opportunity",
compiledTemplate({
appUrl,
tableRows: [
{ label: "Community", value: "Senior 55+" },
{ label: "Applications Due", value: "August 11, 2021" },
{ label: "Address", value: "2330 Webster Street, Oakland CA 94612" },
{ label: "1 Bedrooms", value: "1 unit, 1 bath, 668 sqft" },
{ label: "2 Bedrooms", value: "2 units, 1-2 baths, 900 - 968 sqft" },
{ label: "Rent", value: "$1,251 - $1,609 per month" },
{ label: "Minimum Income", value: "$2,502 - $3,218 per month" },
{ label: "Maximum Income", value: "$6,092 - $10,096 per month" },
{ label: "Lottery Date", value: "August 31, 2021" },
],
})
)
}

private async loadTranslations(jurisdiction: Jurisdiction | null, language: Language) {
let jurisdictionalTranslations: Translation | null,
genericTranslations: Translation | null,
Expand Down
42 changes: 42 additions & 0 deletions backend/core/src/shared/views/listing-opportunity.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{{#> layout_default }}

<h1><span class="intro">Rental opportunity at</span> <br />Listing name</h1>
<table class="inset fit-content" role="presentation" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td>
<div>
<table role="presentation" border="1px" cellpadding="12px" cellspacing="0" class="bordered fit-content">
{{#each tableRows}}
<tr>
<td class="bold">
{{label}}
</td>
<td>
{{value}}
</td>
</tr>
{{/each}}
</table>
</div>
</td>
</tr>
</tbody>
</table>

<table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td align="center">
<a
class="btn btn-primary"
href="{{listingUrl}}"
target="_blank"
style="color:white"
>View Listing & Apply
</a>
</td>
</tr>
</tbody>
</table>
{{/layout_default }}
8 changes: 8 additions & 0 deletions backend/core/src/shared/views/partials/head.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,10 @@
font-size: 22px;
}
.bold {
font-weight: 700;
}
/* -------------------------------------
BUTTONS
------------------------------------- */
Expand Down Expand Up @@ -337,6 +341,10 @@
margin: 20px 0;
}
.fit-content {
max-width: fit-content;
}
/* -------------------------------------
RESPONSIVE AND MOBILE FRIENDLY STYLES
------------------------------------- */
Expand Down
4 changes: 2 additions & 2 deletions sites/public/src/lib/helpers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -383,8 +383,8 @@ export const getSiteFooter = () => {
<br /> San Francisco, CA 94105-2066
<br /> {t("footer.mondayToFriday")}
<br />
<a href="mailto: bahfa@bayareametro.gov" className="underline">
bahfa@bayareametro.gov
<a href="mailto: doorway@bayareametro.gov" className="underline">
doorway@bayareametro.gov
</a>
</p>
</div>
Expand Down

0 comments on commit bf5f117

Please sign in to comment.