-
-
Notifications
You must be signed in to change notification settings - Fork 275
/
Copy pathInvoicePaymentEmailSchema.tsx
64 lines (57 loc) · 1.39 KB
/
InvoicePaymentEmailSchema.tsx
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
export interface InvoicePaymentEmailSchemaProps {
companyName: string;
companyLogoUri: string;
total: string;
currencyCode: string;
dueDate: string;
paymentUrl: string;
invoiceNumber: string;
invoiceDate: string;
}
export function InvoicePaymentEmailSchema({
companyName,
companyLogoUri,
currencyCode,
total,
paymentUrl,
dueDate,
invoiceDate,
invoiceNumber
}: InvoicePaymentEmailSchemaProps) {
return (
<script type="application/ld+json">
{`
{
"@context": "http://schema.org",
"@type": "Invoice",
"description": "Invoice for services rendered",
"paymentStatus": "http://schema.org/PaymentDue",
"totalPaymentDue": {
"@type": "MonetaryAmount",
"currency": "${currencyCode}",
"value": "${total}"
},
"provider": {
"@type": "Organization",
"name": "${companyName}",
"logo": "${companyLogoUri}",
"telephone": "+1234567890"
},
"paymentDueDate": "${dueDate}",
"paymentUrl": "${paymentUrl}",
"referencesOrder": {
"@type": "Order",
"orderNumber": "${invoiceNumber}",
"orderStatus": "http://schema.org/OrderPaymentDue",
"orderDate": "${invoiceDate}"
},
"potentialAction": {
"@type": "ViewAction",
"target": "${paymentUrl}",
"name": "View and Pay Invoice"
}
}
`}
</script>
);
}