I like to greet students by their name, something like:
"Hi {name}, how can I help you?"
If I could support that by default it would save me some time.
Seems simple enough, just save the string here (No change).
Then template here, filling in relevant variables to the user.
You could use pupa:
export function useTeams(
queueId: number,
users: string,
message: string
): () => void {
const isQueueOnline = useQueue(queueId).queue?.room.startsWith("Online");
function openTeams(): void {
const userData = getUserDataFromSomewhere(users); // TODO
const filledInMessage = pupa(message, { name: userData.name }, { ignoreMissing: true})
if (isQueueOnline) {
window.open(
`https://teams.microsoft.com/l/chat/0/0?users=${users}&message=${filledInMessage}`
);
}
}
return openTeams;
}
I like to greet students by their name, something like:
If I could support that by default it would save me some time.
Seems simple enough, just save the string here (No change).
Then template here, filling in relevant variables to the user.
You could use pupa: