Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor the email shutdown function
Register email_shutdown_function() from a new generic helper API, mantis_shutdown_functions_register(); this could be used to add other shutdown functions or a plugin event in the future. The shutdown function is now always registered, and the logic to determine whether to call email_send_all() or not has been moved into it. This allows removal of the delay implemented in the previous version to avoid concurrent executions. The $g_email_stored global variable has been renamed and is now used as a binary flag which drives the shutdown function's behavior. By setting this flag, the request can - indicate that emails have been generated, allowing the shutdown function to trigger email_send_all() only when necessary - force sending of emails in the shutdown function, regardless of $g_email_send_using_cronjob setting (useful e.g. for signup or password reset processes, where we don't want to delay notifications). To implement that behavior, a new optional parameter ($p_force) was added to the email_store() function. These changes are derived from vboctor's comments in PR 589. Issue #17460
- Loading branch information
Showing
5 changed files
with
65 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters