-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathdeal-won.email.ts
More file actions
36 lines (32 loc) · 1.68 KB
/
Copy pathdeal-won.email.ts
File metadata and controls
36 lines (32 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.
import type { EmailTemplateDefinitionInput } from '@objectstack/spec/system';
/**
* Sent when an opportunity moves to Closed Won.
* Referenced by the `notify_owner_deal_won` workflow action.
*/
export const DealWonEmail: EmailTemplateDefinitionInput = {
name: 'crm.deal_won',
label: 'Deal Won — Owner Congrats',
category: 'workflow',
locale: 'en-US',
subject: 'Congratulations — {{opportunity.name}} closed!',
bodyHtml: `<!doctype html><html><body style="font-family:-apple-system,Segoe UI,Roboto,sans-serif;line-height:1.5;color:#1f2937;margin:0;padding:24px;background:#f9fafb">
<div style="max-width:560px;margin:0 auto;background:#ffffff;padding:32px;border-radius:8px;border:1px solid #e5e7eb">
<h1 style="margin:0 0 16px 0;font-size:20px;font-weight:600">Great news!</h1>
<p>Hi {{user.name}},</p>
<p>The opportunity <strong>{{opportunity.name}}</strong> for {{account.name}} just closed at <strong>\${{opportunity.amount}}</strong>.</p>
<p>Nice work! 🎉</p>
</div>
</body></html>`,
bodyText: `Hi {{user.name}},
The opportunity {{opportunity.name}} for {{account.name}} just closed at \${{opportunity.amount}}.
Nice work!`,
variables: [
{ name: 'user.name', type: 'string', required: true, description: 'Opportunity owner' },
{ name: 'opportunity.name', type: 'string', required: true },
{ name: 'opportunity.amount', type: 'number', required: true, description: 'Closed amount in USD' },
{ name: 'account.name', type: 'string', required: true },
],
active: true,
description: 'Internal congrats email fired by the High-Value Deal workflow when stage = Closed Won.',
};