@intelligo-dev/core 1.0.0-beta.1 → 1.0.0-beta.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +6 -0
- package/README.md +102 -0
- package/dist/attachments/errors.d.ts +7 -0
- package/dist/attachments/errors.d.ts.map +1 -0
- package/dist/attachments/errors.js +11 -0
- package/dist/attachments/errors.js.map +1 -0
- package/dist/attachments/index.d.ts +8 -0
- package/dist/attachments/index.d.ts.map +1 -0
- package/dist/attachments/index.js +7 -0
- package/dist/attachments/index.js.map +1 -0
- package/dist/attachments/service.d.ts +45 -0
- package/dist/attachments/service.d.ts.map +1 -0
- package/dist/attachments/service.js +100 -0
- package/dist/attachments/service.js.map +1 -0
- package/dist/attachments/types.d.ts +6 -0
- package/dist/attachments/types.d.ts.map +1 -0
- package/dist/attachments/types.js +2 -0
- package/dist/attachments/types.js.map +1 -0
- package/dist/conversations/errors.d.ts +2 -8
- package/dist/conversations/errors.d.ts.map +1 -1
- package/dist/conversations/errors.js +2 -8
- package/dist/conversations/errors.js.map +1 -1
- package/dist/conversations/index.d.ts +4 -12
- package/dist/conversations/index.d.ts.map +1 -1
- package/dist/conversations/index.js +2 -11
- package/dist/conversations/index.js.map +1 -1
- package/dist/conversations/service.d.ts +49 -61
- package/dist/conversations/service.d.ts.map +1 -1
- package/dist/conversations/service.js +110 -83
- package/dist/conversations/service.js.map +1 -1
- package/dist/conversations/types.d.ts +1 -4
- package/dist/conversations/types.d.ts.map +1 -1
- package/dist/conversations/types.js +0 -3
- package/dist/conversations/types.js.map +1 -1
- package/dist/db/client.d.ts +21 -10
- package/dist/db/client.d.ts.map +1 -1
- package/dist/db/client.js +43 -18
- package/dist/db/client.js.map +1 -1
- package/dist/db/index.d.ts +3 -3
- package/dist/db/index.d.ts.map +1 -1
- package/dist/db/index.js +3 -7
- package/dist/db/index.js.map +1 -1
- package/dist/db/schema/agents.d.ts +14 -51
- package/dist/db/schema/agents.d.ts.map +1 -1
- package/dist/db/schema/agents.js +9 -21
- package/dist/db/schema/agents.js.map +1 -1
- package/dist/db/schema/ai.d.ts +86 -1556
- package/dist/db/schema/ai.d.ts.map +1 -1
- package/dist/db/schema/ai.js +32 -236
- package/dist/db/schema/ai.js.map +1 -1
- package/dist/db/schema/auth.d.ts +5 -34
- package/dist/db/schema/auth.d.ts.map +1 -1
- package/dist/db/schema/auth.js +25 -56
- package/dist/db/schema/auth.js.map +1 -1
- package/dist/db/schema/billing.d.ts +136 -107
- package/dist/db/schema/billing.d.ts.map +1 -1
- package/dist/db/schema/billing.js +72 -60
- package/dist/db/schema/billing.js.map +1 -1
- package/dist/db/schema/feature-flags.d.ts +3 -12
- package/dist/db/schema/feature-flags.d.ts.map +1 -1
- package/dist/db/schema/feature-flags.js +3 -12
- package/dist/db/schema/feature-flags.js.map +1 -1
- package/dist/db/schema/identity.d.ts +12 -274
- package/dist/db/schema/identity.d.ts.map +1 -1
- package/dist/db/schema/identity.js +19 -104
- package/dist/db/schema/identity.js.map +1 -1
- package/dist/db/schema/index.d.ts +8 -15
- package/dist/db/schema/index.d.ts.map +1 -1
- package/dist/db/schema/index.js +12 -42
- package/dist/db/schema/index.js.map +1 -1
- package/dist/db/schema/notifications.d.ts +3 -17
- package/dist/db/schema/notifications.d.ts.map +1 -1
- package/dist/db/schema/notifications.js +3 -17
- package/dist/db/schema/notifications.js.map +1 -1
- package/dist/db/schema/usage.d.ts +94 -77
- package/dist/db/schema/usage.d.ts.map +1 -1
- package/dist/db/schema/usage.js +59 -89
- package/dist/db/schema/usage.js.map +1 -1
- package/dist/db/validate.d.ts +2 -11
- package/dist/db/validate.d.ts.map +1 -1
- package/dist/db/validate.js +6 -17
- package/dist/db/validate.js.map +1 -1
- package/dist/db/workspace-queries.d.ts +5 -29
- package/dist/db/workspace-queries.d.ts.map +1 -1
- package/dist/db/workspace-queries.js +5 -29
- package/dist/db/workspace-queries.js.map +1 -1
- package/dist/documents/classifier.d.ts +5 -12
- package/dist/documents/classifier.d.ts.map +1 -1
- package/dist/documents/classifier.js +16 -16
- package/dist/documents/classifier.js.map +1 -1
- package/dist/documents/errors.d.ts +2 -10
- package/dist/documents/errors.d.ts.map +1 -1
- package/dist/documents/errors.js +2 -10
- package/dist/documents/errors.js.map +1 -1
- package/dist/documents/index.d.ts +4 -13
- package/dist/documents/index.d.ts.map +1 -1
- package/dist/documents/index.js +3 -12
- package/dist/documents/index.js.map +1 -1
- package/dist/documents/service.d.ts +19 -26
- package/dist/documents/service.d.ts.map +1 -1
- package/dist/documents/service.js +44 -38
- package/dist/documents/service.js.map +1 -1
- package/dist/documents/types.d.ts +6 -10
- package/dist/documents/types.d.ts.map +1 -1
- package/dist/documents/types.js +0 -3
- package/dist/documents/types.js.map +1 -1
- package/dist/email/brand.d.ts +17 -0
- package/dist/email/brand.d.ts.map +1 -0
- package/dist/email/brand.js +9 -0
- package/dist/email/brand.js.map +1 -0
- package/dist/email/index.d.ts +4 -4
- package/dist/email/index.js +4 -4
- package/dist/email/provider.d.ts +1 -7
- package/dist/email/provider.d.ts.map +1 -1
- package/dist/email/provider.js +10 -19
- package/dist/email/provider.js.map +1 -1
- package/dist/email/send.d.ts +12 -12
- package/dist/email/send.d.ts.map +1 -1
- package/dist/email/send.js +5 -19
- package/dist/email/send.js.map +1 -1
- package/dist/email/senders.d.ts +17 -30
- package/dist/email/senders.d.ts.map +1 -1
- package/dist/email/senders.js +33 -47
- package/dist/email/senders.js.map +1 -1
- package/dist/email/templates/base-layout.d.ts +1 -1
- package/dist/email/templates/base-layout.d.ts.map +1 -1
- package/dist/email/templates/base-layout.js +4 -6
- package/dist/email/templates/base-layout.js.map +1 -1
- package/dist/email/templates/index.d.ts +10 -10
- package/dist/email/templates/index.d.ts.map +1 -1
- package/dist/email/templates/index.js +10 -16
- package/dist/email/templates/index.js.map +1 -1
- package/dist/email/templates/password-reset.d.ts +2 -2
- package/dist/email/templates/password-reset.d.ts.map +1 -1
- package/dist/email/templates/password-reset.js +10 -22
- package/dist/email/templates/password-reset.js.map +1 -1
- package/dist/email/templates/payment-failed.d.ts +2 -2
- package/dist/email/templates/payment-failed.d.ts.map +1 -1
- package/dist/email/templates/payment-failed.js +11 -24
- package/dist/email/templates/payment-failed.js.map +1 -1
- package/dist/email/templates/quota-warning.d.ts +4 -4
- package/dist/email/templates/quota-warning.d.ts.map +1 -1
- package/dist/email/templates/quota-warning.js +19 -39
- package/dist/email/templates/quota-warning.js.map +1 -1
- package/dist/email/templates/subscription-confirmed.d.ts +2 -2
- package/dist/email/templates/subscription-confirmed.d.ts.map +1 -1
- package/dist/email/templates/subscription-confirmed.js +13 -28
- package/dist/email/templates/subscription-confirmed.js.map +1 -1
- package/dist/email/templates/trial-expiry.d.ts +2 -2
- package/dist/email/templates/trial-expiry.d.ts.map +1 -1
- package/dist/email/templates/trial-expiry.js +12 -36
- package/dist/email/templates/trial-expiry.js.map +1 -1
- package/dist/email/templates/trial-warning.d.ts +2 -2
- package/dist/email/templates/trial-warning.d.ts.map +1 -1
- package/dist/email/templates/trial-warning.js +15 -32
- package/dist/email/templates/trial-warning.js.map +1 -1
- package/dist/email/templates/verify-email.d.ts +2 -2
- package/dist/email/templates/verify-email.d.ts.map +1 -1
- package/dist/email/templates/verify-email.js +10 -22
- package/dist/email/templates/verify-email.js.map +1 -1
- package/dist/email/templates/welcome.d.ts +2 -2
- package/dist/email/templates/welcome.d.ts.map +1 -1
- package/dist/email/templates/welcome.js +13 -20
- package/dist/email/templates/welcome.js.map +1 -1
- package/dist/email/templates/workspace-invitation.d.ts +2 -2
- package/dist/email/templates/workspace-invitation.d.ts.map +1 -1
- package/dist/email/templates/workspace-invitation.js +12 -26
- package/dist/email/templates/workspace-invitation.js.map +1 -1
- package/dist/env.d.ts +5 -10
- package/dist/env.d.ts.map +1 -1
- package/dist/env.js +41 -31
- package/dist/env.js.map +1 -1
- package/dist/identity/audit.d.ts +11 -24
- package/dist/identity/audit.d.ts.map +1 -1
- package/dist/identity/audit.js +13 -27
- package/dist/identity/audit.js.map +1 -1
- package/dist/identity/errors.d.ts +4 -12
- package/dist/identity/errors.d.ts.map +1 -1
- package/dist/identity/errors.js +2 -8
- package/dist/identity/errors.js.map +1 -1
- package/dist/identity/index.d.ts +5 -13
- package/dist/identity/index.d.ts.map +1 -1
- package/dist/identity/index.js +4 -12
- package/dist/identity/index.js.map +1 -1
- package/dist/identity/service.d.ts +13 -47
- package/dist/identity/service.d.ts.map +1 -1
- package/dist/identity/service.js +31 -78
- package/dist/identity/service.js.map +1 -1
- package/dist/identity/types.d.ts +1 -4
- package/dist/identity/types.d.ts.map +1 -1
- package/dist/identity/types.js +0 -3
- package/dist/identity/types.js.map +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -10
- package/dist/index.js.map +1 -1
- package/dist/logger.d.ts +7 -18
- package/dist/logger.d.ts.map +1 -1
- package/dist/logger.js +45 -49
- package/dist/logger.js.map +1 -1
- package/dist/money.d.ts +95 -0
- package/dist/money.d.ts.map +1 -0
- package/dist/money.js +208 -0
- package/dist/money.js.map +1 -0
- package/dist/notifications/index.d.ts +9 -43
- package/dist/notifications/index.d.ts.map +1 -1
- package/dist/notifications/index.js +9 -49
- package/dist/notifications/index.js.map +1 -1
- package/dist/notifications/triggers.d.ts +9 -32
- package/dist/notifications/triggers.d.ts.map +1 -1
- package/dist/notifications/triggers.js +21 -58
- package/dist/notifications/triggers.js.map +1 -1
- package/dist/notifications/types.d.ts +1 -10
- package/dist/notifications/types.d.ts.map +1 -1
- package/dist/notifications/types.js +0 -9
- package/dist/notifications/types.js.map +1 -1
- package/dist/prompt.d.ts +38 -0
- package/dist/prompt.d.ts.map +1 -0
- package/dist/prompt.js +118 -0
- package/dist/prompt.js.map +1 -0
- package/dist/registry.d.ts +32 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +60 -0
- package/dist/registry.js.map +1 -0
- package/dist/request-context.d.ts +49 -0
- package/dist/request-context.d.ts.map +1 -0
- package/dist/request-context.js +100 -0
- package/dist/request-context.js.map +1 -0
- package/dist/storage/index.d.ts +65 -0
- package/dist/storage/index.d.ts.map +1 -0
- package/dist/storage/index.js +109 -0
- package/dist/storage/index.js.map +1 -0
- package/package.json +74 -24
- package/src/attachments/errors.ts +18 -0
- package/src/attachments/index.ts +22 -0
- package/src/attachments/service.ts +178 -0
- package/src/attachments/types.ts +6 -0
- package/src/conversations/errors.ts +45 -0
- package/src/conversations/index.ts +39 -0
- package/src/conversations/service.ts +594 -0
- package/src/conversations/types.ts +15 -0
- package/src/db/client.ts +91 -0
- package/src/db/index.ts +3 -0
- package/src/db/migrations/0000_baseline.sql +652 -0
- package/src/db/migrations/0001_reconcile_chain_built_databases.sql +53 -0
- package/src/db/migrations/0002_webhook_claim_lease.sql +1 -0
- package/src/db/migrations/README.md +74 -36
- package/src/db/migrations/legacy-chain.json +197 -0
- package/src/db/migrations/meta/0000_snapshot.json +4182 -157
- package/src/db/migrations/meta/0002_snapshot.json +2478 -368
- package/src/db/migrations/meta/_journal.json +6 -279
- package/src/db/schema/agents.ts +57 -0
- package/src/db/schema/ai.ts +174 -0
- package/src/db/schema/auth.ts +183 -0
- package/src/db/schema/billing.ts +209 -0
- package/src/db/schema/feature-flags.ts +20 -0
- package/src/db/schema/identity.ts +250 -0
- package/src/db/schema/index.ts +12 -0
- package/src/db/schema/notifications.ts +31 -0
- package/src/db/schema/usage.ts +269 -0
- package/src/db/validate.ts +63 -0
- package/src/db/workspace-queries.ts +64 -0
- package/src/documents/classifier.ts +61 -0
- package/src/documents/errors.ts +44 -0
- package/src/documents/index.ts +24 -0
- package/src/documents/service.ts +256 -0
- package/src/documents/types.ts +24 -0
- package/src/email/brand.ts +24 -0
- package/src/email/index.ts +19 -0
- package/src/email/provider.ts +278 -0
- package/src/email/send.ts +169 -0
- package/src/email/senders.ts +292 -0
- package/src/email/templates/base-layout.tsx +145 -0
- package/src/email/templates/index.ts +28 -0
- package/src/email/templates/password-reset.tsx +72 -0
- package/src/email/templates/payment-failed.tsx +77 -0
- package/src/email/templates/quota-warning.tsx +118 -0
- package/src/email/templates/subscription-confirmed.tsx +91 -0
- package/src/email/templates/trial-expiry.tsx +124 -0
- package/src/email/templates/trial-warning.tsx +104 -0
- package/src/email/templates/verify-email.tsx +72 -0
- package/src/email/templates/welcome.tsx +64 -0
- package/src/email/templates/workspace-invitation.tsx +105 -0
- package/src/env.ts +180 -0
- package/src/identity/audit.ts +65 -0
- package/src/identity/errors.ts +44 -0
- package/src/identity/index.ts +26 -0
- package/src/identity/service.ts +202 -0
- package/src/identity/types.ts +28 -0
- package/src/index.ts +4 -0
- package/src/logger.ts +198 -0
- package/src/money.ts +270 -0
- package/src/notifications/index.ts +108 -0
- package/src/notifications/triggers.ts +158 -0
- package/src/notifications/types.ts +18 -0
- package/src/prompt.ts +142 -0
- package/src/registry.ts +75 -0
- package/src/request-context.ts +137 -0
- package/src/storage/index.ts +153 -0
- package/dist/db/schema/rag.d.ts +0 -171
- package/dist/db/schema/rag.d.ts.map +0 -1
- package/dist/db/schema/rag.js +0 -42
- package/dist/db/schema/rag.js.map +0 -1
- package/src/db/migrations/0000_sharp_night_nurse.sql +0 -52
- package/src/db/migrations/0001_hesitant_vapor.sql +0 -40
- package/src/db/migrations/0002_numerous_lady_vermin.sql +0 -235
- package/src/db/migrations/0003_mighty_jean_grey.sql +0 -37
- package/src/db/migrations/0004_cynical_grandmaster.sql +0 -2
- package/src/db/migrations/0005_careful_switch.sql +0 -8
- package/src/db/migrations/0006_tense_blue_marvel.sql +0 -16
- package/src/db/migrations/0007_next_squadron_sinister.sql +0 -1
- package/src/db/migrations/0008_powerful_scream.sql +0 -39
- package/src/db/migrations/0009_sad_ink.sql +0 -1
- package/src/db/migrations/0010_shocking_omega_flight.sql +0 -2
- package/src/db/migrations/0011_ambiguous_otto_octavius.sql +0 -151
- package/src/db/migrations/0011_hnsw_vector_index.sql +0 -17
- package/src/db/migrations/0012_user_profiles.sql +0 -30
- package/src/db/migrations/0013_trending_seasonal_columns.sql +0 -9
- package/src/db/migrations/0014_add_product_type_to_agents.sql +0 -6
- package/src/db/migrations/0015_new_v1_tables.sql +0 -149
- package/src/db/migrations/0016_document_types.sql +0 -30
- package/src/db/migrations/0017_document_metadata.sql +0 -2
- package/src/db/migrations/0018_identity_graph.sql +0 -200
- package/src/db/migrations/0019_db_driven_prompts.sql +0 -20
- package/src/db/migrations/0020_pending_extractions.sql +0 -35
- package/src/db/migrations/0021_rag_documents.sql +0 -39
- package/src/db/migrations/0022_user_quotas_usage_jsonb.sql +0 -70
- package/src/db/migrations/0023_user_facts_user_scoped_unique.sql +0 -17
- package/src/db/migrations/0024_user_memories_hnsw.sql +0 -23
- package/src/db/migrations/0025_audit_trigger_errcode.sql +0 -21
- package/src/db/migrations/0026_user_profile_snapshots_composite_pk.sql +0 -17
- package/src/db/migrations/0027_billing_settings_mnt_columns.sql +0 -54
- package/src/db/migrations/0028_trial_credits_normalized_email.sql +0 -37
- package/src/db/migrations/0029_usage_records_conversation_idx.sql +0 -13
- package/src/db/migrations/0030_pending_extractions_composite_idx.sql +0 -11
- package/src/db/migrations/0031_rag_documents_hnsw.sql +0 -16
- package/src/db/migrations/0032_rate_limit_unique_idx.sql +0 -16
- package/src/db/migrations/0033_pending_extractions_partial_idx.sql +0 -18
- package/src/db/migrations/0034_rate_limit_count.sql +0 -9
- package/src/db/migrations/0035_credit_reservations.sql +0 -24
- package/src/db/migrations/0036_executions_audit_jobs.sql +0 -96
- package/src/db/migrations/0037_rate_limit_minute_bucket.sql +0 -46
- package/src/db/migrations/0038_user_quotas_generic_usage.sql +0 -25
- package/src/db/migrations/0039_platform_admin_impersonation.sql +0 -27
- package/src/db/migrations/0040_ee_audit_chain.sql +0 -23
- package/src/db/migrations/meta/0001_snapshot.json +0 -631
- package/src/db/migrations/meta/0003_snapshot.json +0 -2488
- package/src/db/migrations/meta/0004_snapshot.json +0 -2500
- package/src/db/migrations/meta/0005_snapshot.json +0 -2548
- package/src/db/migrations/meta/0006_snapshot.json +0 -2650
- package/src/db/migrations/meta/0007_snapshot.json +0 -2657
- package/src/db/migrations/meta/0008_snapshot.json +0 -2719
- package/src/db/migrations/meta/0009_snapshot.json +0 -2726
- package/src/db/migrations/meta/0010_snapshot.json +0 -2739
- package/src/db/migrations/meta/0011_snapshot.json +0 -3886
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { Button, Text } from "@react-email/components";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { BaseLayout } from "./base-layout";
|
|
4
|
+
|
|
5
|
+
export interface PaymentFailedEmailProps {
|
|
6
|
+
workspaceName: string;
|
|
7
|
+
amount: string;
|
|
8
|
+
updatePaymentUrl: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function PaymentFailedEmail({
|
|
12
|
+
workspaceName,
|
|
13
|
+
amount,
|
|
14
|
+
updatePaymentUrl,
|
|
15
|
+
}: PaymentFailedEmailProps) {
|
|
16
|
+
const text = {
|
|
17
|
+
preview: `Payment failed for ${workspaceName}`,
|
|
18
|
+
heading: "Payment Failed",
|
|
19
|
+
body1: "We were unable to process the payment of",
|
|
20
|
+
body2: "for your workspace",
|
|
21
|
+
body3: "",
|
|
22
|
+
warning:
|
|
23
|
+
"Your subscription will be restricted to free limits after a 3-day grace period if payment is not updated.",
|
|
24
|
+
button: "Update Payment Method",
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<BaseLayout preview={text.preview}>
|
|
29
|
+
<Text style={headingStyle}>{text.heading}</Text>
|
|
30
|
+
<Text style={bodyTextStyle}>
|
|
31
|
+
{text.body1} <strong>{amount}</strong> {text.body2} ‘
|
|
32
|
+
{workspaceName}’{text.body3}
|
|
33
|
+
</Text>
|
|
34
|
+
<Text style={warningTextStyle}>{text.warning}</Text>
|
|
35
|
+
<Button href={updatePaymentUrl} style={buttonStyle}>
|
|
36
|
+
{text.button}
|
|
37
|
+
</Button>
|
|
38
|
+
</BaseLayout>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const headingStyle: React.CSSProperties = {
|
|
43
|
+
color: "#18181b",
|
|
44
|
+
fontSize: "22px",
|
|
45
|
+
fontWeight: 700,
|
|
46
|
+
lineHeight: "30px",
|
|
47
|
+
margin: "0 0 16px",
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const bodyTextStyle: React.CSSProperties = {
|
|
51
|
+
color: "#18181b",
|
|
52
|
+
fontSize: "15px",
|
|
53
|
+
lineHeight: "24px",
|
|
54
|
+
margin: "0 0 12px",
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const warningTextStyle: React.CSSProperties = {
|
|
58
|
+
color: "#dc2626",
|
|
59
|
+
fontSize: "15px",
|
|
60
|
+
fontWeight: 600,
|
|
61
|
+
lineHeight: "24px",
|
|
62
|
+
margin: "0 0 12px",
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
const buttonStyle: React.CSSProperties = {
|
|
66
|
+
backgroundColor: "#7c3aed",
|
|
67
|
+
borderRadius: "6px",
|
|
68
|
+
color: "#ffffff",
|
|
69
|
+
display: "inline-block",
|
|
70
|
+
fontSize: "15px",
|
|
71
|
+
fontWeight: 600,
|
|
72
|
+
lineHeight: "100%",
|
|
73
|
+
padding: "12px 24px",
|
|
74
|
+
textDecoration: "none",
|
|
75
|
+
textAlign: "center" as const,
|
|
76
|
+
marginTop: "8px",
|
|
77
|
+
};
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { Button, Text } from "@react-email/components";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { BaseLayout } from "./base-layout";
|
|
4
|
+
|
|
5
|
+
// `isExceeded` switches between the 80% warning and the used-up variant.
|
|
6
|
+
// `used` and `allowance` arrive formatted: the plan allowance is money in
|
|
7
|
+
// the deployment's billing currency, and the sender owns the formatting.
|
|
8
|
+
|
|
9
|
+
export interface QuotaWarningEmailProps {
|
|
10
|
+
workspaceName: string;
|
|
11
|
+
percentageUsed: number;
|
|
12
|
+
used: string;
|
|
13
|
+
allowance: string;
|
|
14
|
+
upgradeUrl: string;
|
|
15
|
+
isExceeded: boolean;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function QuotaWarningEmail({
|
|
19
|
+
workspaceName,
|
|
20
|
+
percentageUsed,
|
|
21
|
+
used,
|
|
22
|
+
allowance,
|
|
23
|
+
upgradeUrl,
|
|
24
|
+
isExceeded,
|
|
25
|
+
}: QuotaWarningEmailProps) {
|
|
26
|
+
const text = {
|
|
27
|
+
previewExceeded: "Your monthly allowance is used up",
|
|
28
|
+
previewWarning: `You've used ${percentageUsed}% of your monthly allowance`,
|
|
29
|
+
headingExceeded: "Allowance Used Up",
|
|
30
|
+
headingWarning: "Allowance Warning",
|
|
31
|
+
bodyExceeded1: "Your workspace",
|
|
32
|
+
bodyExceeded2: "has used all of its",
|
|
33
|
+
bodyExceeded3: "monthly allowance.",
|
|
34
|
+
warningText:
|
|
35
|
+
"AI features are currently restricted until your allowance resets or you upgrade.",
|
|
36
|
+
bodyWarning1: "Your workspace",
|
|
37
|
+
bodyWarning2: "has used",
|
|
38
|
+
bodyWarning3: "of its",
|
|
39
|
+
bodyWarning4: "monthly allowance",
|
|
40
|
+
button: "Upgrade Plan",
|
|
41
|
+
note: "Your allowance resets at the start of next month.",
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<BaseLayout
|
|
46
|
+
preview={isExceeded ? text.previewExceeded : text.previewWarning}
|
|
47
|
+
>
|
|
48
|
+
<Text style={headingStyle}>
|
|
49
|
+
{isExceeded ? text.headingExceeded : text.headingWarning}
|
|
50
|
+
</Text>
|
|
51
|
+
|
|
52
|
+
{isExceeded ? (
|
|
53
|
+
<>
|
|
54
|
+
<Text style={bodyTextStyle}>
|
|
55
|
+
{text.bodyExceeded1} ‘{workspaceName}’{" "}
|
|
56
|
+
{text.bodyExceeded2} {allowance} {text.bodyExceeded3}
|
|
57
|
+
</Text>
|
|
58
|
+
<Text style={warningTextStyle}>{text.warningText}</Text>
|
|
59
|
+
</>
|
|
60
|
+
) : (
|
|
61
|
+
<Text style={bodyTextStyle}>
|
|
62
|
+
{text.bodyWarning1} ‘{workspaceName}’ {text.bodyWarning2}{" "}
|
|
63
|
+
{used} {text.bodyWarning3} {allowance} {text.bodyWarning4} (
|
|
64
|
+
{percentageUsed}%).
|
|
65
|
+
</Text>
|
|
66
|
+
)}
|
|
67
|
+
|
|
68
|
+
<Button href={upgradeUrl} style={buttonStyle}>
|
|
69
|
+
{text.button}
|
|
70
|
+
</Button>
|
|
71
|
+
<Text style={noteStyle}>{text.note}</Text>
|
|
72
|
+
</BaseLayout>
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const headingStyle: React.CSSProperties = {
|
|
77
|
+
color: "#18181b",
|
|
78
|
+
fontSize: "22px",
|
|
79
|
+
fontWeight: 700,
|
|
80
|
+
lineHeight: "30px",
|
|
81
|
+
margin: "0 0 16px",
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
const bodyTextStyle: React.CSSProperties = {
|
|
85
|
+
color: "#18181b",
|
|
86
|
+
fontSize: "15px",
|
|
87
|
+
lineHeight: "24px",
|
|
88
|
+
margin: "0 0 12px",
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
const warningTextStyle: React.CSSProperties = {
|
|
92
|
+
color: "#dc2626",
|
|
93
|
+
fontSize: "15px",
|
|
94
|
+
fontWeight: 600,
|
|
95
|
+
lineHeight: "24px",
|
|
96
|
+
margin: "0 0 12px",
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
const buttonStyle: React.CSSProperties = {
|
|
100
|
+
backgroundColor: "#7c3aed",
|
|
101
|
+
borderRadius: "6px",
|
|
102
|
+
color: "#ffffff",
|
|
103
|
+
display: "inline-block",
|
|
104
|
+
fontSize: "15px",
|
|
105
|
+
fontWeight: 600,
|
|
106
|
+
lineHeight: "100%",
|
|
107
|
+
padding: "12px 24px",
|
|
108
|
+
textDecoration: "none",
|
|
109
|
+
textAlign: "center" as const,
|
|
110
|
+
marginTop: "8px",
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
const noteStyle: React.CSSProperties = {
|
|
114
|
+
color: "#71717a",
|
|
115
|
+
fontSize: "13px",
|
|
116
|
+
lineHeight: "20px",
|
|
117
|
+
marginTop: "20px",
|
|
118
|
+
};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { Button, Text } from "@react-email/components";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { BaseLayout } from "./base-layout";
|
|
4
|
+
|
|
5
|
+
export interface SubscriptionConfirmedEmailProps {
|
|
6
|
+
workspaceName: string;
|
|
7
|
+
planName: string;
|
|
8
|
+
amount: string;
|
|
9
|
+
dashboardUrl: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function SubscriptionConfirmedEmail({
|
|
13
|
+
workspaceName,
|
|
14
|
+
planName,
|
|
15
|
+
amount,
|
|
16
|
+
dashboardUrl,
|
|
17
|
+
}: SubscriptionConfirmedEmailProps) {
|
|
18
|
+
const text = {
|
|
19
|
+
preview: `Subscription confirmed for ${workspaceName}`,
|
|
20
|
+
heading: "Subscription Confirmed",
|
|
21
|
+
body1: "Your workspace",
|
|
22
|
+
body2: "is now on the",
|
|
23
|
+
body3: "plan.",
|
|
24
|
+
amountLabel: "Amount:",
|
|
25
|
+
perMonth: "/month",
|
|
26
|
+
button: "Go to Dashboard",
|
|
27
|
+
note: "You can manage your subscription from the billing settings.",
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<BaseLayout preview={text.preview}>
|
|
32
|
+
<Text style={headingStyle}>{text.heading}</Text>
|
|
33
|
+
<Text style={bodyTextStyle}>
|
|
34
|
+
{text.body1} ‘{workspaceName}’ {text.body2}{" "}
|
|
35
|
+
<strong>{planName}</strong> {text.body3}
|
|
36
|
+
</Text>
|
|
37
|
+
<Text style={detailStyle}>
|
|
38
|
+
{text.amountLabel} {amount}
|
|
39
|
+
{text.perMonth}
|
|
40
|
+
</Text>
|
|
41
|
+
<Button href={dashboardUrl} style={buttonStyle}>
|
|
42
|
+
{text.button}
|
|
43
|
+
</Button>
|
|
44
|
+
<Text style={noteStyle}>{text.note}</Text>
|
|
45
|
+
</BaseLayout>
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const headingStyle: React.CSSProperties = {
|
|
50
|
+
color: "#18181b",
|
|
51
|
+
fontSize: "22px",
|
|
52
|
+
fontWeight: 700,
|
|
53
|
+
lineHeight: "30px",
|
|
54
|
+
margin: "0 0 16px",
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const bodyTextStyle: React.CSSProperties = {
|
|
58
|
+
color: "#18181b",
|
|
59
|
+
fontSize: "15px",
|
|
60
|
+
lineHeight: "24px",
|
|
61
|
+
margin: "0 0 12px",
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const detailStyle: React.CSSProperties = {
|
|
65
|
+
color: "#18181b",
|
|
66
|
+
fontSize: "15px",
|
|
67
|
+
fontWeight: 600,
|
|
68
|
+
lineHeight: "24px",
|
|
69
|
+
margin: "0 0 16px",
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
const buttonStyle: React.CSSProperties = {
|
|
73
|
+
backgroundColor: "#7c3aed",
|
|
74
|
+
borderRadius: "6px",
|
|
75
|
+
color: "#ffffff",
|
|
76
|
+
display: "inline-block",
|
|
77
|
+
fontSize: "15px",
|
|
78
|
+
fontWeight: 600,
|
|
79
|
+
lineHeight: "100%",
|
|
80
|
+
padding: "12px 24px",
|
|
81
|
+
textDecoration: "none",
|
|
82
|
+
textAlign: "center" as const,
|
|
83
|
+
marginTop: "8px",
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
const noteStyle: React.CSSProperties = {
|
|
87
|
+
color: "#71717a",
|
|
88
|
+
fontSize: "13px",
|
|
89
|
+
lineHeight: "20px",
|
|
90
|
+
marginTop: "20px",
|
|
91
|
+
};
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { Button, Text } from "@react-email/components";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { BaseLayout } from "./base-layout";
|
|
4
|
+
|
|
5
|
+
// `daysRemaining` switches between the reminder and expired variants.
|
|
6
|
+
|
|
7
|
+
export interface TrialExpiryEmailProps {
|
|
8
|
+
workspaceName: string;
|
|
9
|
+
expiryDate: string;
|
|
10
|
+
daysRemaining: number;
|
|
11
|
+
upgradeUrl: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function TrialExpiryEmail({
|
|
15
|
+
workspaceName,
|
|
16
|
+
expiryDate,
|
|
17
|
+
daysRemaining,
|
|
18
|
+
upgradeUrl,
|
|
19
|
+
}: TrialExpiryEmailProps) {
|
|
20
|
+
const isExpired = daysRemaining <= 0;
|
|
21
|
+
const isUrgent = daysRemaining <= 1 && daysRemaining > 0;
|
|
22
|
+
|
|
23
|
+
const days = `${daysRemaining} day${daysRemaining === 1 ? "" : "s"}`;
|
|
24
|
+
const text = {
|
|
25
|
+
previewExpired: "Your trial has ended",
|
|
26
|
+
previewExpiring: `Your trial ends in ${days}`,
|
|
27
|
+
headingExpired: "Your Trial Has Ended",
|
|
28
|
+
headingExpiring: `Your Trial Ends in ${days}`,
|
|
29
|
+
buttonExpired: "Choose a Plan",
|
|
30
|
+
buttonUpgrade: "Upgrade Now",
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<BaseLayout
|
|
35
|
+
preview={isExpired ? text.previewExpired : text.previewExpiring}
|
|
36
|
+
>
|
|
37
|
+
<Text style={headingStyle}>
|
|
38
|
+
{isExpired ? text.headingExpired : text.headingExpiring}
|
|
39
|
+
</Text>
|
|
40
|
+
|
|
41
|
+
{isExpired ? (
|
|
42
|
+
<>
|
|
43
|
+
<Text style={bodyTextStyle}>
|
|
44
|
+
The trial for ‘{workspaceName}’ has ended, and the
|
|
45
|
+
workspace is back on its plan’s limits. All your data has been
|
|
46
|
+
preserved.
|
|
47
|
+
</Text>
|
|
48
|
+
<Text style={bodyTextStyle}>
|
|
49
|
+
Upgrade to restore what the trial included.
|
|
50
|
+
</Text>
|
|
51
|
+
</>
|
|
52
|
+
) : (
|
|
53
|
+
<>
|
|
54
|
+
<Text style={bodyTextStyle}>
|
|
55
|
+
The trial for ‘{workspaceName}’ ends on{" "}
|
|
56
|
+
<strong>{expiryDate}</strong>. After that the workspace goes back to
|
|
57
|
+
its plan’s limits; all your data will be preserved.
|
|
58
|
+
</Text>
|
|
59
|
+
{isUrgent && (
|
|
60
|
+
<Text style={urgentTextStyle}>
|
|
61
|
+
Upgrade today to keep what the trial includes.
|
|
62
|
+
</Text>
|
|
63
|
+
)}
|
|
64
|
+
<Text style={secondaryTextStyle}>
|
|
65
|
+
No action is needed if the current plan is enough for you.
|
|
66
|
+
</Text>
|
|
67
|
+
</>
|
|
68
|
+
)}
|
|
69
|
+
|
|
70
|
+
<Button href={upgradeUrl} style={buttonStyle}>
|
|
71
|
+
{isExpired ? text.buttonExpired : text.buttonUpgrade}
|
|
72
|
+
</Button>
|
|
73
|
+
</BaseLayout>
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const headingStyle: React.CSSProperties = {
|
|
78
|
+
color: "#18181b",
|
|
79
|
+
fontSize: "22px",
|
|
80
|
+
fontWeight: 700,
|
|
81
|
+
lineHeight: "30px",
|
|
82
|
+
margin: "0 0 16px",
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
const bodyTextStyle: React.CSSProperties = {
|
|
86
|
+
color: "#18181b",
|
|
87
|
+
fontSize: "15px",
|
|
88
|
+
lineHeight: "24px",
|
|
89
|
+
margin: "0 0 12px",
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
const urgentTextStyle: React.CSSProperties = {
|
|
93
|
+
color: "#dc2626",
|
|
94
|
+
fontSize: "16px",
|
|
95
|
+
fontWeight: 700,
|
|
96
|
+
lineHeight: "24px",
|
|
97
|
+
margin: "12px 0",
|
|
98
|
+
padding: "12px",
|
|
99
|
+
backgroundColor: "#fef2f2",
|
|
100
|
+
borderRadius: "6px",
|
|
101
|
+
border: "1px solid #fecaca",
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
const secondaryTextStyle: React.CSSProperties = {
|
|
105
|
+
color: "#71717a",
|
|
106
|
+
fontSize: "14px",
|
|
107
|
+
lineHeight: "20px",
|
|
108
|
+
margin: "12px 0 0",
|
|
109
|
+
fontStyle: "italic",
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
const buttonStyle: React.CSSProperties = {
|
|
113
|
+
backgroundColor: "#7c3aed",
|
|
114
|
+
borderRadius: "6px",
|
|
115
|
+
color: "#ffffff",
|
|
116
|
+
display: "inline-block",
|
|
117
|
+
fontSize: "15px",
|
|
118
|
+
fontWeight: 600,
|
|
119
|
+
lineHeight: "100%",
|
|
120
|
+
padding: "12px 24px",
|
|
121
|
+
textDecoration: "none",
|
|
122
|
+
textAlign: "center" as const,
|
|
123
|
+
marginTop: "16px",
|
|
124
|
+
};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { Button, Text } from "@react-email/components";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { BaseLayout } from "./base-layout";
|
|
4
|
+
|
|
5
|
+
// `isDepleted` switches between the low-credit and depleted variants.
|
|
6
|
+
|
|
7
|
+
export interface TrialWarningEmailProps {
|
|
8
|
+
workspaceName: string;
|
|
9
|
+
creditsRemaining: number;
|
|
10
|
+
totalCredits: number;
|
|
11
|
+
percentageRemaining: number;
|
|
12
|
+
upgradeUrl: string;
|
|
13
|
+
isDepleted: boolean;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function TrialWarningEmail({
|
|
17
|
+
workspaceName,
|
|
18
|
+
creditsRemaining,
|
|
19
|
+
totalCredits,
|
|
20
|
+
percentageRemaining,
|
|
21
|
+
upgradeUrl,
|
|
22
|
+
isDepleted,
|
|
23
|
+
}: TrialWarningEmailProps) {
|
|
24
|
+
const text = {
|
|
25
|
+
previewDepleted: "Your trial credits are depleted",
|
|
26
|
+
previewWarning: "Your trial credits are running low",
|
|
27
|
+
headingDepleted: "Trial Credits Depleted",
|
|
28
|
+
headingWarning: "Trial Credits Running Low",
|
|
29
|
+
bodyDepleted1: "Your workspace",
|
|
30
|
+
bodyDepleted2: "has used all trial credits.",
|
|
31
|
+
warningText: "Subscribe to a plan to continue using AI features.",
|
|
32
|
+
bodyWarning1: "Your workspace",
|
|
33
|
+
bodyWarning2: "has",
|
|
34
|
+
bodyWarning3: "trial credits remaining",
|
|
35
|
+
button: "Subscribe Now",
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<BaseLayout
|
|
40
|
+
preview={isDepleted ? text.previewDepleted : text.previewWarning}
|
|
41
|
+
>
|
|
42
|
+
<Text style={headingStyle}>
|
|
43
|
+
{isDepleted ? text.headingDepleted : text.headingWarning}
|
|
44
|
+
</Text>
|
|
45
|
+
|
|
46
|
+
{isDepleted ? (
|
|
47
|
+
<>
|
|
48
|
+
<Text style={bodyTextStyle}>
|
|
49
|
+
{text.bodyDepleted1} ‘{workspaceName}’{" "}
|
|
50
|
+
{text.bodyDepleted2}
|
|
51
|
+
</Text>
|
|
52
|
+
<Text style={warningTextStyle}>{text.warningText}</Text>
|
|
53
|
+
</>
|
|
54
|
+
) : (
|
|
55
|
+
<Text style={bodyTextStyle}>
|
|
56
|
+
{text.bodyWarning1} ‘{workspaceName}’ {text.bodyWarning2}{" "}
|
|
57
|
+
{creditsRemaining.toLocaleString()} / {totalCredits.toLocaleString()}{" "}
|
|
58
|
+
{text.bodyWarning3} ({percentageRemaining}%).
|
|
59
|
+
</Text>
|
|
60
|
+
)}
|
|
61
|
+
|
|
62
|
+
<Button href={upgradeUrl} style={buttonStyle}>
|
|
63
|
+
{text.button}
|
|
64
|
+
</Button>
|
|
65
|
+
</BaseLayout>
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const headingStyle: React.CSSProperties = {
|
|
70
|
+
color: "#18181b",
|
|
71
|
+
fontSize: "22px",
|
|
72
|
+
fontWeight: 700,
|
|
73
|
+
lineHeight: "30px",
|
|
74
|
+
margin: "0 0 16px",
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
const bodyTextStyle: React.CSSProperties = {
|
|
78
|
+
color: "#18181b",
|
|
79
|
+
fontSize: "15px",
|
|
80
|
+
lineHeight: "24px",
|
|
81
|
+
margin: "0 0 12px",
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
const warningTextStyle: React.CSSProperties = {
|
|
85
|
+
color: "#dc2626",
|
|
86
|
+
fontSize: "15px",
|
|
87
|
+
fontWeight: 600,
|
|
88
|
+
lineHeight: "24px",
|
|
89
|
+
margin: "0 0 12px",
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
const buttonStyle: React.CSSProperties = {
|
|
93
|
+
backgroundColor: "#7c3aed",
|
|
94
|
+
borderRadius: "6px",
|
|
95
|
+
color: "#ffffff",
|
|
96
|
+
display: "inline-block",
|
|
97
|
+
fontSize: "15px",
|
|
98
|
+
fontWeight: 600,
|
|
99
|
+
lineHeight: "100%",
|
|
100
|
+
padding: "12px 24px",
|
|
101
|
+
textDecoration: "none",
|
|
102
|
+
textAlign: "center" as const,
|
|
103
|
+
marginTop: "8px",
|
|
104
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { Button, Text } from "@react-email/components";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { BaseLayout } from "./base-layout";
|
|
4
|
+
|
|
5
|
+
export interface VerifyEmailEmailProps {
|
|
6
|
+
userName: string;
|
|
7
|
+
verificationUrl: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function VerifyEmailEmail({
|
|
11
|
+
userName,
|
|
12
|
+
verificationUrl,
|
|
13
|
+
}: VerifyEmailEmailProps) {
|
|
14
|
+
const text = {
|
|
15
|
+
preview: "Verify your email address",
|
|
16
|
+
heading: "Verify your email",
|
|
17
|
+
greeting: "Hi",
|
|
18
|
+
body: "Please verify your email address by clicking the button below.",
|
|
19
|
+
button: "Verify Email",
|
|
20
|
+
note: "This link expires in 24 hours. If you didn't create an account, you can safely ignore this email.",
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<BaseLayout preview={text.preview}>
|
|
25
|
+
<Text style={headingStyle}>{text.heading}</Text>
|
|
26
|
+
<Text style={bodyTextStyle}>
|
|
27
|
+
{text.greeting} {userName},
|
|
28
|
+
</Text>
|
|
29
|
+
<Text style={bodyTextStyle}>{text.body}</Text>
|
|
30
|
+
<Button href={verificationUrl} style={buttonStyle}>
|
|
31
|
+
{text.button}
|
|
32
|
+
</Button>
|
|
33
|
+
<Text style={noteStyle}>{text.note}</Text>
|
|
34
|
+
</BaseLayout>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const headingStyle: React.CSSProperties = {
|
|
39
|
+
color: "#18181b",
|
|
40
|
+
fontSize: "22px",
|
|
41
|
+
fontWeight: 700,
|
|
42
|
+
lineHeight: "30px",
|
|
43
|
+
margin: "0 0 16px",
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const bodyTextStyle: React.CSSProperties = {
|
|
47
|
+
color: "#18181b",
|
|
48
|
+
fontSize: "15px",
|
|
49
|
+
lineHeight: "24px",
|
|
50
|
+
margin: "0 0 12px",
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const buttonStyle: React.CSSProperties = {
|
|
54
|
+
backgroundColor: "#7c3aed",
|
|
55
|
+
borderRadius: "6px",
|
|
56
|
+
color: "#ffffff",
|
|
57
|
+
display: "inline-block",
|
|
58
|
+
fontSize: "15px",
|
|
59
|
+
fontWeight: 600,
|
|
60
|
+
lineHeight: "100%",
|
|
61
|
+
padding: "12px 24px",
|
|
62
|
+
textDecoration: "none",
|
|
63
|
+
textAlign: "center" as const,
|
|
64
|
+
marginTop: "8px",
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
const noteStyle: React.CSSProperties = {
|
|
68
|
+
color: "#71717a",
|
|
69
|
+
fontSize: "13px",
|
|
70
|
+
lineHeight: "20px",
|
|
71
|
+
marginTop: "20px",
|
|
72
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Button, Text } from "@react-email/components";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { emailBrand } from "../brand";
|
|
4
|
+
import { BaseLayout } from "./base-layout";
|
|
5
|
+
|
|
6
|
+
export interface WelcomeEmailProps {
|
|
7
|
+
userName: string;
|
|
8
|
+
dashboardUrl: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function WelcomeEmail({ userName, dashboardUrl }: WelcomeEmailProps) {
|
|
12
|
+
const { name } = emailBrand();
|
|
13
|
+
const text = {
|
|
14
|
+
preview: name
|
|
15
|
+
? `Welcome to ${name}, ${userName}!`
|
|
16
|
+
: `Welcome, ${userName}!`,
|
|
17
|
+
heading: name ? `Welcome to ${name}` : "Welcome",
|
|
18
|
+
greeting: "Hi",
|
|
19
|
+
body: "Thanks for signing up! You're all set to start using AI-powered tools to boost your productivity.",
|
|
20
|
+
button: "Go to Dashboard",
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<BaseLayout preview={text.preview}>
|
|
25
|
+
<Text style={headingStyle}>{text.heading}</Text>
|
|
26
|
+
<Text style={bodyTextStyle}>
|
|
27
|
+
{text.greeting} {userName},
|
|
28
|
+
</Text>
|
|
29
|
+
<Text style={bodyTextStyle}>{text.body}</Text>
|
|
30
|
+
<Button href={dashboardUrl} style={buttonStyle}>
|
|
31
|
+
{text.button}
|
|
32
|
+
</Button>
|
|
33
|
+
</BaseLayout>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const headingStyle: React.CSSProperties = {
|
|
38
|
+
color: "#18181b",
|
|
39
|
+
fontSize: "22px",
|
|
40
|
+
fontWeight: 700,
|
|
41
|
+
lineHeight: "30px",
|
|
42
|
+
margin: "0 0 16px",
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const bodyTextStyle: React.CSSProperties = {
|
|
46
|
+
color: "#18181b",
|
|
47
|
+
fontSize: "15px",
|
|
48
|
+
lineHeight: "24px",
|
|
49
|
+
margin: "0 0 12px",
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
const buttonStyle: React.CSSProperties = {
|
|
53
|
+
backgroundColor: "#7c3aed",
|
|
54
|
+
borderRadius: "6px",
|
|
55
|
+
color: "#ffffff",
|
|
56
|
+
display: "inline-block",
|
|
57
|
+
fontSize: "15px",
|
|
58
|
+
fontWeight: 600,
|
|
59
|
+
lineHeight: "100%",
|
|
60
|
+
padding: "12px 24px",
|
|
61
|
+
textDecoration: "none",
|
|
62
|
+
textAlign: "center" as const,
|
|
63
|
+
marginTop: "8px",
|
|
64
|
+
};
|