Hi all,
I have been following the Carcassonne tutorial to implement at my work place - however, this will not be integrated in Slack, but rather just using the grouping function for games of the groups choice. I have enabled the grouping, but now would like to send emails directly to the groups to inform them of their randomly chosen groups.
I am able to send emails to the ‘player_rows’ which identifies everyone thats available to play - but I would like to isolate the emails to just the rows of groups.
Code Sample:
def announce_games():
current_games = app_tables.users.search(enabled=True)
player_rows = [game['email'] for game in current_games]
for i, group in enumerate(current_games):
random_id = random.sample(player_rows, k=3)[0]
response = anvil.email.send(to= player_rows,
text=f"By royal degree you {str(len(player_rows))} citizens {random_id} you have been randomly chosen to start the royal game.")
The groups of players are stored in rows in ‘games’ with a column called ‘players’ I have tried various app_tables.games etc. but with no results!
Any assistance is greatly appreciated!
Thanks