I need to send a mail description after each movement.

Here you have the patch, but it is possible you may improve it.

Thank you very much.

PD: This is the first time I make a patch, so tell me if it is wrong.

CommentFileSizeAuthor
#2 chess.patch3.47 KBmagmax

Comments

Tim_O’s picture

I cannot see any patch included, did you forget to actually enclose it?

Then, there is integration with the rules module build into chess. So you can just install rules and send emails using that way. Just in case you didn't know - this might allow you to do what you're aiming at ...

magmax’s picture

StatusFileSize
new3.47 KB

Ups... I'm sorry.

Here you are.

I didn't know about the game module, so I didn't know about game module integration :-D

Despite of it, I send the patch for your consideration.

Tim_O’s picture

Status: Patch (to be ported) » Needs work

Thank you, magmax. I had a look at it, and maybe it would indeed be a good idea to offer build-in email-support for people that don't have/want the rules-module, so let's see ...

It should be a configurable feature (possibility to disable it), because if one uses rules-integration then you probably don't want any other emails. There should be an according section in chess_admin_settings() and then according if-clauses around the other related code. If you are saving such a setting for each game seperately (it looked like that), that would probably need another option to choose between "disabled", "per-game-setting", "enabled", probably with the possibility to choose a default-value if using "per-game-setting". That would need some additional logic around the code then. One could do this on a per-user basis (via user-profile) also, but the question is what's most important/sensible? I personally would go for just a side-wide config, but you probably had your reasons to have it per-game? Let me know what you think about these integration options ...

I don't have much time for this project at the moment. But I still plan to make a release of 6.x at least, probably sometime next month. If you are going to do any work on this let me know so we can get this as a feature into it. Otherwise I might further this idea sometime later myself ...