Page 1 of 1

Callback E-mail

Posted: Fri Mar 26, 2010 2:00 pm
by cuervo5150
Greetings Kent,

Would you please show me how to use the Callback feature at the end of a daily tournament to send a generic congratulatory e-mail to the winner. I know it's sort of redundant because the player knows they won, but I want the player to feel they were recognized for thier accomplishment.

As always, thank you for your assistance,

Re: Callback E-mail

Posted: Fri Mar 26, 2010 3:47 pm
by Kent Briggs
cuervo5150 wrote: Would you please show me how to use the Callback feature at the end of a daily tournament to send a generic congratulatory e-mail to the winner.
That would require a few hours of coding. I'll give you the outline of it:

The Tournament Finish Event will call your PHP file and include a tournament "Name" and "Number" parameter. Use the Name and the current date to retrieve the tournament results file for that tournament using the TournamentsResult command in the API. Parse through that output looking for the tournament Number. Parse some more looking for the Place1 line. Pull the player's name out of that line. Parse some more looking for the Stop line to make sure it doesn't show "(Abort)" on the end. With the player's name, call the AccountsGet command in the API and fetch the player's email address. Use the PHP mail() command to send the email.

Re: Callback E-mail

Posted: Tue Apr 13, 2010 3:41 am
by social
Kent Briggs wrote:
cuervo5150 wrote: a tournament "Name" and "Number" parameter.
Could you give me an example of how the Number parameter is used?
What is it for?

Re: Callback E-mail

Posted: Tue Apr 13, 2010 9:13 am
by Kent Briggs
social wrote: Could you give me an example of how the Number parameter is used?
What is it for?
It's just a sequential number that gets incremented every time a new tournament starts on your site. It gives each one a unique number that you can use for your own purposes.