Skip to content

Commit

Permalink
fix: link and unit fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ludtkemorgan committed Nov 7, 2023
1 parent 020b4eb commit 03ccdef
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion backend/core/src/email/email.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ export class EmailService {

const compiled = compiledTemplate({
listingName: listing.name,
listingUrl: jurisdiction.publicUrl,
listingUrl: `${jurisdiction.publicUrl}/listings/${listing.id}`,
tableRows,
})

Expand Down
11 changes: 10 additions & 1 deletion backend/core/src/listings/listings.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,16 @@ export class ListingsService {
previousStatus !== ListingStatus.active &&
jurisdiction.enableListingOpportunity
) {
await this.emailService.listingOpportunity(saveResponse)
// The email send to gov delivery should not be a blocker from the normal flow so wrapping this in a try catch
try {
const units = await this.getUnitsForListing(saveResponse.id)
await this.emailService.listingOpportunity({
...saveResponse,
units: units.units,
} as Listing)
} catch (error) {
console.error(`Error: unable to send to govDelivery ${error}`)
}
}
return saveResponse
}
Expand Down

0 comments on commit 03ccdef

Please sign in to comment.