diff --git a/apps/api/src/email/templates/automation-failures.tsx b/apps/api/src/email/templates/automation-failures.tsx new file mode 100644 index 000000000..5a5f5f5e0 --- /dev/null +++ b/apps/api/src/email/templates/automation-failures.tsx @@ -0,0 +1,125 @@ +import * as React from 'react'; +import { + Body, + Button, + Container, + Font, + Heading, + Html, + Link, + Preview, + Section, + Tailwind, + Text, +} from '@react-email/components'; +import { Footer } from '../components/footer'; +import { Logo } from '../components/logo'; +import { getUnsubscribeUrl } from '@trycompai/email'; + +interface Props { + toName: string; + toEmail: string; + taskTitle: string; + failedCount: number; + totalCount: number; + taskStatusChanged: boolean; + organizationName: string; + taskUrl: string; +} + +export const AutomationFailuresEmail = ({ + toName, + toEmail, + taskTitle, + failedCount, + totalCount, + taskStatusChanged, + organizationName, + taskUrl, +}: Props) => { + const unsubscribeUrl = getUnsubscribeUrl(toEmail); + + return ( + + + + + + + + {`${failedCount} of ${totalCount} automation(s) failed on task "${taskTitle}"`} + + + + + + + Automation Failures + + + + Hello {toName}, + + + + {failedCount} of {totalCount} automation(s) + failed on task "{taskTitle}" in{' '} + {organizationName}. + + + {taskStatusChanged && ( + + Task status has been changed to Failed. + + )} + +
+ +
+ + + or copy and paste this URL into your browser:{' '} + + {taskUrl} + + + +
+ + Don't want to receive task assignment notifications?{' '} + + Manage your email preferences + + . + +
+ +
+ +