-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
239 additions
and
8 deletions.
There are no files selected for viewing
79 changes: 79 additions & 0 deletions
79
apps/dashboard/src/components/template-store/templates/appointment-reminder.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
import { StepTypeEnum, WorkflowCreationSourceEnum } from '@novu/shared'; | ||
import { WorkflowTemplate } from './types'; | ||
|
||
export const appointmentReminderTemplate: WorkflowTemplate = { | ||
id: 'clinic-appointment-reminder', | ||
name: 'Clinic Appointment Reminder', | ||
description: | ||
'The workflow reminds the patient about the upcoming appointment and also prompt for feedback after the appointment.', | ||
category: 'operational', | ||
isPopular: false, | ||
workflowDefinition: { | ||
name: 'Clinic Appointment Reminder', | ||
description: | ||
'The workflow reminds the patient about the upcoming appointment and also prompt for feedback after the appointment.', | ||
workflowId: 'clinic-appointment-reminder', | ||
steps: [ | ||
{ | ||
name: 'Email Step', | ||
type: StepTypeEnum.EMAIL, | ||
controlValues: { | ||
body: '{"type":"doc","content":[{"type":"image","attrs":{"src":"http://img.freepik.com/free-vector/health-care-logo-icon_125964-471.jpg?ga=GA1.1.747163298.1730994384&semt=ais_hybrid","alt":null,"title":null,"width":136,"height":136,"alignment":"center","externalLink":null,"isExternalLinkVariable":false,"isSrcVariable":false,"showIfKey":null}},{"type":"heading","attrs":{"textAlign":"left","level":3},"content":[{"type":"text","text":"See you soon, "},{"type":"variable","attrs":{"id":"subscriber.firstName","label":null,"fallback":null,"required":false}},{"type":"text","text":" !"}]},{"type":"horizontalRule"},{"type":"paragraph","attrs":{"textAlign":"left"},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"#000000"}}],"text":"This is a reminder about the appointment you have schedualed in our clinic."}]},{"type":"section","attrs":{"borderRadius":0,"backgroundColor":"","align":"left","borderWidth":0,"borderColor":"","paddingTop":0,"paddingRight":0,"paddingBottom":0,"paddingLeft":0,"marginTop":0,"marginRight":0,"marginBottom":0,"marginLeft":0,"showIfKey":null},"content":[{"type":"section","attrs":{"borderRadius":6,"backgroundColor":"#f5f5f5","align":"left","borderWidth":0,"borderColor":"#e2e2e2","paddingTop":12,"paddingRight":12,"paddingBottom":12,"paddingLeft":12,"marginTop":0,"marginRight":0,"marginBottom":0,"marginLeft":0,"showIfKey":null},"content":[{"type":"section","attrs":{"borderRadius":0,"backgroundColor":"","align":"left","borderWidth":0,"borderColor":"","paddingTop":0,"paddingRight":0,"paddingBottom":0,"paddingLeft":0,"marginTop":0,"marginRight":0,"marginBottom":0,"marginLeft":0,"showIfKey":null},"content":[{"type":"section","attrs":{"borderRadius":6,"backgroundColor":"","align":"left","borderWidth":0,"borderColor":"","paddingTop":0,"paddingRight":0,"paddingBottom":0,"paddingLeft":0,"marginTop":0,"marginRight":0,"marginBottom":0,"marginLeft":0,"showIfKey":null},"content":[{"type":"columns","attrs":{"showIfKey":null,"gap":8},"content":[{"type":"column","attrs":{"columnId":"b3e24c39-bc09-4e95-b267-8c73b6a3e69b","width":"auto","verticalAlign":"top"},"content":[{"type":"paragraph","attrs":{"textAlign":"left"},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"Appointment date"},{"type":"hardBreak"},{"type":"variable","attrs":{"id":"payload.appointment_date","label":null,"fallback":"Monday, 16 November at 11:00","required":true}},{"type":"text","text":" "}]},{"type":"paragraph","attrs":{"textAlign":"left"},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"Appointment with"},{"type":"hardBreak"},{"type":"variable","attrs":{"id":"payload.assigned_doctor","label":null,"fallback":null,"required":false}},{"type":"text","text":" "}]}]},{"type":"column","attrs":{"columnId":"35f83ecc-9254-4a1a-a554-325b8572b78e","width":"auto","verticalAlign":"top"},"content":[{"type":"paragraph","attrs":{"textAlign":"left"},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"Appointment Type"},{"type":"hardBreak"},{"type":"variable","attrs":{"id":"payload.appointment_type","label":null,"fallback":null,"required":true}}]},{"type":"paragraph","attrs":{"textAlign":"left"},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"Appointment at"},{"type":"hardBreak"},{"type":"variable","attrs":{"id":"payload.clinic_address","label":null,"fallback":null,"required":false}},{"type":"text","text":" "}]}]}]}]}]}]},{"type":"footer","attrs":{"textAlign":"left","maily-component":"footer"}},{"type":"horizontalRule"},{"type":"footer","attrs":{"textAlign":"left","maily-component":"footer"},"content":[{"type":"text","text":"You\'re receiving this email, as you have an appointment services booked with us, please follow "},{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"#0062ff"}},{"type":"underline"}],"text":"this"},{"type":"text","text":" link to "},{"type":"text","marks":[{"type":"underline"}],"text":"rescedule"},{"type":"text","text":" or "},{"type":"text","marks":[{"type":"underline"}],"text":"cancel"},{"type":"text","text":" the appointment. "}]}]}]}', | ||
Check warning on line 21 in apps/dashboard/src/components/template-store/templates/appointment-reminder.ts GitHub Actions / Spell check
|
||
subject: 'Reminder: Upcoming Appointment on {{payload.appointment_date}}', | ||
}, | ||
}, | ||
{ | ||
name: 'Delay Step', | ||
type: StepTypeEnum.DELAY, | ||
controlValues: { | ||
amount: 5, | ||
unit: 'days', | ||
type: 'regular', | ||
}, | ||
}, | ||
{ | ||
name: 'SMS Step', | ||
type: StepTypeEnum.SMS, | ||
controlValues: { | ||
body: 'Hey {{subscriber.firstName}}, this is {{payload.assigned_doctor}}. \nJust a reminder, we meet in 48 hours for your appointment at {{payload.clinic_name}}.', | ||
}, | ||
}, | ||
{ | ||
name: 'Delay Step', | ||
type: StepTypeEnum.DELAY, | ||
controlValues: { | ||
amount: 24, | ||
unit: 'hours', | ||
type: 'regular', | ||
}, | ||
}, | ||
{ | ||
name: 'SMS Step', | ||
type: StepTypeEnum.SMS, | ||
controlValues: { | ||
body: 'Hi {{subscriber.firstName}}, your appointment is tomorrow at {{payload.clinic_name}}.\n\nPlease note the following parking instructions:\n\n{{payload.parking_instructions}}\n\nSee you soon!', | ||
}, | ||
}, | ||
{ | ||
name: 'Delay Step', | ||
type: StepTypeEnum.DELAY, | ||
controlValues: { | ||
amount: 2, | ||
unit: 'days', | ||
type: 'regular', | ||
}, | ||
}, | ||
{ | ||
name: 'Email Step', | ||
type: StepTypeEnum.EMAIL, | ||
controlValues: { | ||
body: '{"type":"doc","content":[{"type":"image","attrs":{"src":"https://img.freepik.com/free-vector/health-care-logo-icon_125964-471.jpg?ga=GA1.1.747163298.1730994384&semt=ais_hybrid","alt":null,"title":null,"width":160,"height":160,"alignment":"center","externalLink":null,"isExternalLinkVariable":false,"isSrcVariable":false,"showIfKey":null}},{"type":"horizontalRule"},{"type":"paragraph","attrs":{"textAlign":"left"},"content":[{"type":"text","text":"Hi "},{"type":"variable","attrs":{"id":"subscriber.firstName","label":null,"fallback":"John","required":false}},{"type":"text","text":","}]},{"type":"paragraph","attrs":{"textAlign":"left"},"content":[{"type":"text","text":"We hope your appointment with "},{"type":"variable","attrs":{"id":"payload.assigned_doctor","label":null,"fallback":null,"required":false}},{"type":"text","text":" went well. We would love to hear your feedback to help us improve."}]},{"type":"button","attrs":{"text":"60 Seconds Survey ","isTextVariable":false,"url":"payload.feedback_link","isUrlVariable":true,"alignment":"center","variant":"filled","borderRadius":"smooth","buttonColor":"#55b2d3","textColor":"#ffffff","showIfKey":null}},{"type":"paragraph","attrs":{"textAlign":"left"},"content":[{"type":"text","text":"Thank you for choosing "},{"type":"variable","attrs":{"id":"payload.clinic_name","label":null,"fallback":null,"required":false}},{"type":"text","text":". We look forward to seeing you again."}]},{"type":"horizontalRule"},{"type":"paragraph","attrs":{"textAlign":"left"},"content":[{"type":"text","text":"Stay healthy!"}]},{"type":"paragraph","attrs":{"textAlign":"center"}},{"type":"footer","attrs":{"textAlign":"left","maily-component":"footer"},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"#b2b3b4"}}],"text":"This is a mandatory service email to keep you informed about important updates related to your account at "},{"type":"variable","attrs":{"id":"payload.clinic_name","label":null,"fallback":null,"required":false}}]}]}', | ||
subject: 'How was your appointment at {{payload.clinic_name}} clinic?', | ||
}, | ||
}, | ||
], | ||
tags: ['reminders'], | ||
active: true, | ||
__source: WorkflowCreationSourceEnum.TEMPLATE_STORE, | ||
}, | ||
}; |
15 changes: 14 additions & 1 deletion
15
apps/dashboard/src/components/template-store/templates/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,23 @@ | ||
import { accessTokenTemplate } from './access-token'; | ||
import { usageLimitTemplate } from './usage-limit'; | ||
|
||
import { appointmentReminderTemplate } from './appointment-reminder'; | ||
import { otpTemplate } from './otp'; | ||
import { paymentConfirmedTemplate } from './payment-confirmed'; | ||
import { recentLoginTemplate } from './recent-login'; | ||
import { renewalNoticeTemplate } from './renewal-notice'; | ||
import { WorkflowTemplate } from './types'; | ||
|
||
export function getTemplates(): WorkflowTemplate[] { | ||
return [accessTokenTemplate, usageLimitTemplate]; | ||
return [ | ||
accessTokenTemplate, | ||
usageLimitTemplate, | ||
otpTemplate, | ||
renewalNoticeTemplate, | ||
appointmentReminderTemplate, | ||
recentLoginTemplate, | ||
paymentConfirmedTemplate, | ||
]; | ||
} | ||
|
||
export * from './types'; |
35 changes: 35 additions & 0 deletions
35
apps/dashboard/src/components/template-store/templates/otp.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { StepTypeEnum, WorkflowCreationSourceEnum } from '@novu/shared'; | ||
import { WorkflowTemplate } from './types'; | ||
|
||
export const otpTemplate: WorkflowTemplate = { | ||
id: 'one-time-password', | ||
name: 'One Time Password', | ||
description: 'Notify users when they need to verify their identity', | ||
category: 'authentication', | ||
isPopular: true, | ||
workflowDefinition: { | ||
name: 'One Time Password', | ||
description: '', | ||
workflowId: 'one-time-password', | ||
steps: [ | ||
{ | ||
name: 'Email Step', | ||
type: StepTypeEnum.EMAIL, | ||
controlValues: { | ||
subject: ' Verify Your Identity', | ||
body: '{"type":"doc","content":[{"type":"image","attrs":{"src":"https://github.com/novuhq/blog/blob/main/media-assets/5f1528e4a6109a09086e396b5c9d43cb.png?raw=true","alt":null,"title":null,"width":270,"height":203.05785123966945,"alignment":"center","externalLink":null,"isExternalLinkVariable":false,"isSrcVariable":false,"showIfKey":null}},{"type":"heading","attrs":{"textAlign":"center","level":1},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"Enter the following code to finish linking Acmeapp."},{"type":"hardBreak"}]},{"type":"section","attrs":{"borderRadius":0,"backgroundColor":"#f5f5f5","align":"center","borderWidth":2,"borderColor":"#e2e2e2","paddingTop":5,"paddingRight":5,"paddingBottom":5,"paddingLeft":5,"marginTop":0,"marginRight":0,"marginBottom":0,"marginLeft":0,"showIfKey":null},"content":[{"type":"heading","attrs":{"textAlign":"left","level":2},"content":[{"type":"variable","attrs":{"id":"payload.otp","label":null,"fallback":"123456","required":false}}]}]},{"type":"paragraph","attrs":{"textAlign":"center"},"content":[{"type":"hardBreak"},{"type":"text","text":"Not expecting this email?"},{"type":"hardBreak"},{"type":"text","text":"Contact "},{"type":"text","marks":[{"type":"link","attrs":{"href":"mailto:[email protected]","target":"_blank","rel":"noopener noreferrer nofollow","class":"mly-no-underline","isUrlVariable":false}},{"type":"underline"}],"text":"[email protected]"},{"type":"text","text":" if you did not request this code."}]}]}', | ||
}, | ||
}, | ||
{ | ||
name: 'SMS Step', | ||
type: StepTypeEnum.SMS, | ||
controlValues: { | ||
body: 'Your verification code is {{payload.otp}}\n\nDo not share it with anyone.\nThe code expires in 15 minutes', | ||
}, | ||
}, | ||
], | ||
tags: ['authentication'], | ||
active: true, | ||
__source: WorkflowCreationSourceEnum.TEMPLATE_STORE, | ||
}, | ||
}; |
48 changes: 48 additions & 0 deletions
48
apps/dashboard/src/components/template-store/templates/payment-confirmed.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { StepTypeEnum, WorkflowCreationSourceEnum } from '@novu/shared'; | ||
import { WorkflowTemplate } from './types'; | ||
|
||
export const paymentConfirmedTemplate: WorkflowTemplate = { | ||
id: 'payment-confirmed', | ||
name: 'Payment Confirmed', | ||
description: 'Notify users when their payment is confirmed', | ||
category: 'billing', | ||
isPopular: false, | ||
workflowDefinition: { | ||
name: 'Payment Confirmed', | ||
description: '', | ||
workflowId: 'payment-confirmed', | ||
steps: [ | ||
{ | ||
name: 'In-App Step', | ||
type: StepTypeEnum.IN_APP, | ||
controlValues: { | ||
body: 'Your payment of **{{payload.amount}}** for **Acme {{payload.tier}}** has been processed.', | ||
avatar: '', | ||
subject: 'Payment Successful!', | ||
primaryAction: { | ||
label: 'View Receipt', | ||
redirect: { | ||
target: '_self', | ||
url: '{{payload.receipt_link}}', | ||
}, | ||
}, | ||
redirect: { | ||
url: '{{payload.receipt_link}}', | ||
target: '_self', | ||
}, | ||
}, | ||
}, | ||
{ | ||
name: 'Email Step', | ||
type: StepTypeEnum.EMAIL, | ||
controlValues: { | ||
subject: 'Payment Confirmed - Thank You for Your Purchase!', | ||
body: '{"type":"doc","content":[{"type":"image","attrs":{"src":"https://github.com/novuhq/blog/blob/main/media-assets/5f1528e4a6109a09086e396b5c9d43cb.png?raw=true","alt":null,"title":null,"width":167,"height":125,"alignment":"center","externalLink":null,"isExternalLinkVariable":false,"isSrcVariable":false,"showIfKey":null}},{"type":"horizontalRule"},{"type":"paragraph","attrs":{"textAlign":"left"},"content":[{"type":"text","text":"Hi "},{"type":"variable","attrs":{"id":"subscriber.firstName","label":null,"fallback":null,"required":false}},{"type":"text","text":","}]},{"type":"paragraph","attrs":{"textAlign":"left"},"content":[{"type":"text","text":"We\'re happy to let you know that your payment for Acme "},{"type":"variable","attrs":{"id":"payload.tier","label":null,"fallback":null,"required":false}},{"type":"text","text":" has been successfully processed."}]},{"type":"paragraph","attrs":{"textAlign":"left"},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"Details:"}]},{"type":"bulletList","content":[{"type":"listItem","attrs":{"color":""},"content":[{"type":"paragraph","attrs":{"textAlign":"left"},"content":[{"type":"text","text":"Amount: "},{"type":"variable","attrs":{"id":"payload.amount","label":null,"fallback":null,"required":false}}]}]},{"type":"listItem","attrs":{"color":""},"content":[{"type":"paragraph","attrs":{"textAlign":"left"},"content":[{"type":"text","text":"Payment Method: "},{"type":"variable","attrs":{"id":"payload.payment_method","label":null,"fallback":null,"required":false}}]}]},{"type":"listItem","attrs":{"color":""},"content":[{"type":"paragraph","attrs":{"textAlign":"left"},"content":[{"type":"text","text":"Date: "},{"type":"variable","attrs":{"id":"payload.payment_date","label":null,"fallback":null,"required":false}}]}]},{"type":"listItem","attrs":{"color":""},"content":[{"type":"paragraph","attrs":{"textAlign":"left"},"content":[{"type":"text","text":"Order ID: "},{"type":"variable","attrs":{"id":"payload.order_id","label":null,"fallback":null,"required":false}}]}]}]},{"type":"paragraph","attrs":{"textAlign":"left"},"content":[{"type":"text","text":"If you have any questions or need assistance, feel free to reach out."}]},{"type":"paragraph","attrs":{"textAlign":"left"},"content":[{"type":"text","text":"Thank you for your continued trust in Acme!"}]},{"type":"horizontalRule"},{"type":"button","attrs":{"text":"View Receipt","isTextVariable":false,"url":"payload.receipt","isUrlVariable":true,"alignment":"center","variant":"filled","borderRadius":"smooth","buttonColor":"#cd5141","textColor":"#ffffff","showIfKey":null}}]}', | ||
}, | ||
}, | ||
], | ||
tags: ['billing'], | ||
active: true, | ||
__source: WorkflowCreationSourceEnum.TEMPLATE_STORE, | ||
}, | ||
}; |
Oops, something went wrong.