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

Message templates for Pingbox integration #41

Open
encody opened this issue Sep 8, 2021 · 0 comments
Open

Message templates for Pingbox integration #41

encody opened this issue Sep 8, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@encody
Copy link
Member

encody commented Sep 8, 2021

@TrevorJTClarke

There are two possible messages that stats.gallery could send to users right now:

  1. Earned a badge
  2. Advanced to a new level

Earned a badge

Badge acquisition status is determined by the return value of an SQL query to a PostgreSQL indexer server, for example:

select count(*) as result
where exists(
  select *
  from action_receipt_actions
  where action_kind = 'DEPLOY_CONTRACT'
    and receipt_predecessor_account_id = 'hatchet.near'
)

Queries will return 0 when a badge is not acquired, and >0 when a badge is acquired. If the badge is a boolean badge (such as the one above), it will return 1 when the badge is awarded. Some badges have multiple levels (example), so instead of the badge being awarded at any return value >0, there are some predetermined levels, which are established here on the frontend.

Badge queries are stored in badge-*.sql.js files here.

Messaging

Congratulations, you've earned the <badge-name> badge on stats.gallery!

TODO: I can ask a designer to work on messaging and email design/template if desired.

Advanced to a new level

Levels are awarded based on an exponentially increasing score requirement. A user's score is calculated by awarding certain types of on-chain actions with different point values. Levels names are determined here (lvl 10+ is "Nearkat").

Messaging

You've advanced to level <#> and won the title <level-name> on stats.gallery! Look at you go!
@encody encody added the enhancement New feature or request label Sep 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant