Add debug option to output e-mail on screen. Useful for testing that mails look correct.
This commit is contained in:
committed by
WineHQ
parent
b18a91cca7
commit
fa050164f7
@@ -23,6 +23,12 @@ define("BUGZILLA_ROOT","http://bugs.winehq.org/"); // path to bugzilla
|
||||
//if(!defined("DISABLE_EMAIL"))
|
||||
// define("DISABLE_EMAIL", true); // disable email, see mail_appdb() in include/mail.php
|
||||
|
||||
// AppDB developers: Use this define to print the contents of the e-mail instead
|
||||
// of sending it, useful for testing e-mail notifications. Has no effect if
|
||||
// DISABLE_EMAIL is set
|
||||
//if(!defined("PRINT_EMAIL"))
|
||||
// define("PRINT_EMAIL", true); // print email, see mail_appdb() in include/mail.php
|
||||
|
||||
/*
|
||||
* apps database info
|
||||
*/
|
||||
|
||||
@@ -21,6 +21,17 @@ function mail_appdb($sEmailList,$sSubject,$sMsg)
|
||||
$sMsg .= "\n\nIf you don't want to receive any other e-mail, please change your preferences:\n";
|
||||
$sMsg .= APPDB_ROOT."preferences.php\n";
|
||||
|
||||
/* Print the message to the screen instead of sending it, if the PRINT_EMAIL
|
||||
option is set. Output in purple to distinguish it from other messages */
|
||||
if(defined("PRINT_EMAIL"))
|
||||
{
|
||||
$sMsg = str_replace("\n", "<br />", $sMsg);
|
||||
addmsg("This mail would have been sent<br /><br />".
|
||||
"Subject: $sSubject<br /><br />".
|
||||
"Body:<br />$sMsg", "purple");
|
||||
return;
|
||||
}
|
||||
|
||||
$bResult = mail(str_replace(" ",",",$sEmailList), "[AppDB] ".$sSubject, $sMsg, $sHeaders, "-f".APPDB_OWNER_EMAIL);
|
||||
if($bResult)
|
||||
addmsg("Message sent to: ".$sEmailList, "green");
|
||||
|
||||
Reference in New Issue
Block a user