diff --git a/src/components/menu-item.tsx b/src/components/menu-item.tsx
index 31471cb..9bde4bf 100644
--- a/src/components/menu-item.tsx
+++ b/src/components/menu-item.tsx
@@ -59,6 +59,14 @@ export default function MenuItem({
className="m-2 mr-6"
/>
),
+ "Caffè Latte": (
+
+ ),
"Flat White": (
),
+
Macchiato: (
),
+ "Chocolate": (
+
+ ),
Mocha: (
),
+ "British Breakfast Tea": (
+
+ ),
+ "Apple Chamomile": (
+
+ ),
+ "Earl Grey": (
+
+ ),
"Herbal Tea": (
= 50 ? "_limitless" : "";
+
+ const templateName = `${SERVICE_INSTANCE_PREFIX.toLowerCase()}_ready_to_order${limitess}_${availableOptions.length}`;
const template = templates.find((t) => t.friendly_name === templateName);
if (!template) {
@@ -228,7 +231,9 @@ export async function getReadyToOrderWithoutEmailValidationMessage(
contentVariables[key] = value;
});
- const templateName = `${SERVICE_INSTANCE_PREFIX.toLowerCase()}_ready_to_order_without_email_${availableOptions.length}`;
+ const limitess = maxNumberOrders >= 50 ? "_limitless" : "";
+
+ const templateName = `${SERVICE_INSTANCE_PREFIX.toLowerCase()}_ready_to_order${limitess}_without_email_${availableOptions.length}`;
const template = templates.find((t) => t.friendly_name === templateName);
if (!template) {
diff --git a/src/scripts/createTwilioRes.ts b/src/scripts/createTwilioRes.ts
index 0ad1a34..4177b03 100644
--- a/src/scripts/createTwilioRes.ts
+++ b/src/scripts/createTwilioRes.ts
@@ -9,6 +9,8 @@ import {
getWrongOrderTemplate,
getReadyToOrderTemplate,
getReadyToOrderWithoutEmailValidationTemplate,
+ getReadyToOrderLimitlessTemplate,
+ getReadyToOrderLimitlessWithoutEmailValidationTemplate,
getEventRegistrationTemplate,
WhatsAppTemplate,
} from "./getTemplates";
@@ -95,13 +97,42 @@ async function createWhatsAppTemplates() {
);
console.log(`Created Template "${templateName}" ${template.sid}`);
}
+
+ // 5. Check the post_registration_limitless-templates
+ templateName = `${CONTENT_PREFIX}ready_to_order_limitless_${numOptions}`;
+ if (templates.find((c) => c.friendly_name === templateName)) {
+ console.log(
+ `Skip creating Template because "${templateName}" already exists`,
+ );
+ } else {
+ template = await createWhatsAppTemplate(
+ getReadyToOrderLimitlessTemplate(numOptions, templateName),
+ );
+ console.log(`Created Template "${templateName}" ${template.sid}`);
+ }
+
+ // 6. Check the post_registration_limitless_without_email-templates
+ templateName = `${CONTENT_PREFIX}ready_to_order_limitless_without_email_${numOptions}`;
+ if (templates.find((c) => c.friendly_name === templateName)) {
+ console.log(
+ `Skip creating Template because "${templateName}" already exists`,
+ );
+ } else {
+ template = await createWhatsAppTemplate(
+ getReadyToOrderLimitlessWithoutEmailValidationTemplate(
+ numOptions,
+ templateName,
+ ),
+ );
+ console.log(`Created Template "${templateName}" ${template.sid}`);
+ }
}
for (
let numOptions = 2;
numOptions <= MAX_CONCURRENT_EVENTS;
numOptions++
) {
- // 4. Check the event_registration-templates
+ // 6. Check the event_registration-templates
templateName = `${CONTENT_PREFIX}event_registration_${numOptions}`;
if (templates.find((c) => c.friendly_name === templateName)) {
console.log(
@@ -120,4 +151,4 @@ async function createWhatsAppTemplates() {
}
export async function createTwilioRes() {
await createWhatsAppTemplates();
-}
\ No newline at end of file
+}
diff --git a/src/scripts/getTemplates.ts b/src/scripts/getTemplates.ts
index 821f21d..2007b72 100644
--- a/src/scripts/getTemplates.ts
+++ b/src/scripts/getTemplates.ts
@@ -135,6 +135,52 @@ export function getReadyToOrderTemplate(
};
}
+export function getReadyToOrderLimitlessTemplate(
+ numOptions: number,
+ templateName: string,
+): WhatsAppTemplateConfig {
+ // The first variable defines the mode and second is not used
+ // and then 3 additional vars (short title, full title, desc) per options => numOptions * 3 + 1
+
+ const variables = Array.from(Array(numOptions * 3 + 1).keys()).reduce(
+ (accu: any, idx) => {
+ accu[idx] = "";
+ return accu;
+ },
+ {},
+ );
+
+ const indiciesOfFullTitles = [],
+ items = [];
+ for (let i = 0; i < numOptions; i++) {
+ indiciesOfFullTitles.push(`- {{${i * 3 + 2}}}`);
+ items.push({
+ item: `{{${i * 3 + 3}}}`,
+ id: `{{${i * 3 + 3}}}`,
+ description: `{{${i * 3 + 4}}}`,
+ });
+ }
+
+ const body = `Thank you! Your email address has been verified. What would you like? The options are:\n${indiciesOfFullTitles.join(
+ "\n",
+ )}\n`;
+
+ return {
+ friendly_name: templateName,
+ language: "en",
+ variables,
+ types: {
+ "twilio/list-picker": {
+ body,
+ items,
+ button: "More Details",
+ },
+ "twilio/text": {
+ body: body,
+ },
+ },
+ };
+}
export function getReadyToOrderWithoutEmailValidationTemplate(
numOptions: number,
@@ -182,6 +228,53 @@ export function getReadyToOrderWithoutEmailValidationTemplate(
};
}
+export function getReadyToOrderLimitlessWithoutEmailValidationTemplate(
+ numOptions: number,
+ templateName: string,
+): WhatsAppTemplateConfig {
+ // The first variable defines the mode and second is not used
+ // and then 3 additional vars (short title, full title, desc) per options => numOptions * 3 + 1
+
+ const variables = Array.from(Array(numOptions * 3 + 1).keys()).reduce(
+ (accu: any, idx) => {
+ accu[idx] = "";
+ return accu;
+ },
+ {},
+ );
+
+ const indiciesOfFullTitles = [],
+ items = [];
+ for (let i = 0; i < numOptions; i++) {
+ indiciesOfFullTitles.push(`- {{${i * 3 + 2}}}`);
+ items.push({
+ item: `{{${i * 3 + 3}}}`,
+ id: `{{${i * 3 + 3}}}`,
+ description: `{{${i * 3 + 4}}}`,
+ });
+ }
+
+ const body = `What would you like? The options are:\n${indiciesOfFullTitles.join(
+ "\n",
+ )}\n`;
+
+ return {
+ friendly_name: templateName,
+ language: "en",
+ variables,
+ types: {
+ "twilio/list-picker": {
+ body,
+ items,
+ button: "More Details",
+ },
+ "twilio/text": {
+ body: body,
+ },
+ },
+ };
+}
+
export function getEventRegistrationTemplate(
numOptions: number,
templateName: string,