Problem with guild mail
Hey fellow coders,
is there any working solution for sending a mass mail to all members of a guild without getting kicked for spam? In my large trade guild (500 people), we are sending a news mail to our members from time to time. Using the mail function from TIM it stops after ~70 mails and the game kicks for spam. Can this be avoided? Maybe with setting a delay between each mail? |
Yes, that would probably work. I think MailR uses a 1-second delay by default.
|
I checked TIMs code and changed the function that processes the mail queue. Here is my solution:
Lua Code:
to Lua Code:
Is that approach with RegisterForUpdate viable or is there a better way to add a simple delay? |
I guess it is viable for the current source code as the function tim.sendQueuedMail() is called several times, once for each new guil member mail?
As an alternative you could delay the call to this function tim.sendQueuedMail(), use zo_callLater(tim.sendQueuedMail(), 500) or something like this. With other addons I have seen sourc code where the EVENTS (crafting_finished e.g.) was the trigger to call the next process. Maybe there is an event like "MAIL_HAS_BEEN_SENT" and you could use this one to send the next mail (+ delay in between. |
Quote:
* EVENT_MAIL_SEND_SUCCESS |
Thanks for your inputs!
After digging a bit deeper in the code i figured out how TIM handles the mailing. tim.sendQueuedMail() is part of the update callback function (fired from OnUpdate), so one mail from the queue is sent every tick. TIM uses a custom throttle function to control update ticks for special purposes. I ended up using this function in tim.sendQueuedMail() with my desired delay and it works. Here is the final code: Lua Code:
|
All times are GMT -6. The time now is 05:25 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI