Skip to content

Commit

Permalink
fix: email
Browse files Browse the repository at this point in the history
  • Loading branch information
mxkaske committed Mar 5, 2025
1 parent 1af6c3e commit bde0463
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 21 deletions.
26 changes: 10 additions & 16 deletions packages/emails/emails/monitor-alert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@

import {
Body,
Button,
CodeInline,
Column,
Container,
Head,
Heading,
Html,
Img,
Link,
Preview,
Row,
Expand Down Expand Up @@ -62,19 +59,6 @@ const MonitorAlertEmail = (props: MonitorAlertProps) => (
<Preview>Your monitor's status is: {props.type}</Preview>
<Body style={styles.main}>
<Layout>
<Container
style={{
backgroundColor: getIcon(props.type).color,
display: "flex",
alignItems: "center",
justifyContent: "center",
width: "40px",
height: "40px",
borderRadius: "50%",
}}
>
<Img src={getIcon(props.type).src} width="24" height="24" />
</Container>
<Row>
<Column>
<Heading as="h4">{props.name}</Heading>
Expand Down Expand Up @@ -126,6 +110,16 @@ const MonitorAlertEmail = (props: MonitorAlertProps) => (
<Text>{props.region}</Text>
</Column>
</Row>
{props.latency ? (
<Row style={styles.row}>
<Column>
<Text style={styles.bold}>Latency</Text>
</Column>
<Column style={{ textAlign: "right" }}>
<Text>{props.latency}</Text>
</Column>
</Row>
) : null}
<Row style={styles.row}>
<Column>
<Text style={styles.bold}>Timestamp</Text>
Expand Down
10 changes: 5 additions & 5 deletions packages/emails/src/client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export class EmailClient {
const html = await render(<StatusReportEmail {...req} />);
const result = await this.client.batch.send(
req.to.map((subscriber) => ({
from: `${req.pageTitle} <[email protected]>`,
from: `${req.pageTitle} <notifications@notifications.openstatus.dev>`,
subject: req.reportTitle,
to: subscriber,
html,
Expand All @@ -78,7 +78,7 @@ export class EmailClient {
try {
const html = await render(<TeamInvitationEmail {...req} />);
const result = await this.client.emails.send({
from: `${req.workspaceName ?? "OpenStatus"} <[email protected]>`,
from: `${req.workspaceName ?? "OpenStatus"} <notifications@notifications.openstatus.dev>`,
subject: `You've been invited to join ${req.workspaceName ?? "OpenStatus"}`,
to: req.to,
html,
Expand All @@ -101,7 +101,7 @@ export class EmailClient {
try {
const html = await render(<MonitorAlertEmail {...req} />);
const result = await this.client.emails.send({
from: "OpenStatus <[email protected]>",
from: "OpenStatus <notifications@notifications.openstatus.dev>",
subject: `${req.name}: ${req.type.toUpperCase()}`,
to: req.to,
html,
Expand All @@ -126,8 +126,8 @@ export class EmailClient {
try {
const html = await render(<PageSubscriptionEmail {...req} />);
const result = await this.client.emails.send({
from: `${req.page} <[email protected]>`,
subject: "Status page subscription",
from: "Status Page <notifications@notifications.openstatus.dev>",
subject: `Confirm your subscription to ${req.page}`,
to: req.to,
html,
});
Expand Down

0 comments on commit bde0463

Please sign in to comment.