Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: String templating in default Teams messages #928

Open
rymaju opened this issue Jan 24, 2023 · 2 comments
Open

Feature Request: String templating in default Teams messages #928

rymaju opened this issue Jan 24, 2023 · 2 comments

Comments

@rymaju
Copy link

rymaju commented Jan 24, 2023

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;
}
@dfarooq610
Copy link
Collaborator

hi! this sounds really cool! I can take a stab at it, thanks for bringing it up :)

@Mehulparekh144
Copy link

hi! this sounds really cool! I can take a stab at it, thanks for bringing it up :)

Hey are you working on it ? I would like to work on this issue too !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants