在記錄電子郵件之前運行。
參數
變量 | 類型 | 注意 |
---|---|---|
userid | int | |
date | string | 當前時間戳 |
to | string | 逗號分隔的收件人列表 |
cc | string | 以逗號分隔的抄送收件人列表 |
bcc | string | 密件抄送收件人的逗號分隔列表 |
subject | string | |
message | string | |
attachments | array |
響應
接受鍵/值對的返回以覆蓋要記錄的參數。使用與輸入參數相同的名稱。返回 abortLogging
以中止記錄電子郵件。
示例代碼
<?php
//Do not log emails for userid 2
add_hook('EmailPreLog', 1, function($vars) {
$return = [];
if ($vars['userid'] == 2) {
$return['abortLogging'] = true;
}
return $return;
});
//Override the saved subject of the email for userid 3
add_hook('EmailPreLog', 1, function($vars) {
$return = [];
if ($vars['userid'] == 3) {
$return['subject'] = 'This subject is overridden';
}
return $return;
});
相關用法
- PHP WHMCS EmailPreSend用法及代碼示例
- PHP WHMCS EmailTplMergeFields用法及代碼示例
- PHP Explain str_split()用法及代碼示例
- PHP WHMCS EndTaskTimer用法及代碼示例
- PHP Explain array_map()用法及代碼示例
- PHP WHMCS EncryptPassword用法及代碼示例
- PHP WHMCS ClientAreaPageDownloads用法及代碼示例
- PHP Ds\Map isEmpty()用法及代碼示例
- PHP PHPUnit assertIsNotFloat()用法及代碼示例
- PHP disk_total_space()用法及代碼示例
- PHP ReflectionClass getTraitAliases()用法及代碼示例
- PHP hash_hmac()用法及代碼示例
- PHP String wordwrap()用法及代碼示例
- PHP XMLWriter endPi()用法及代碼示例
- PHP SimpleXMLElement children()用法及代碼示例
- PHP IntlCalendar getTimeZone()用法及代碼示例
- PHP SplPriorityQueue isCorrupted()用法及代碼示例
- PHP XMLReader::getParserProperty()用法及代碼示例
- PHP imagegif()用法及代碼示例
- PHP imageresolution()用法及代碼示例
- PHP array_reverse()用法及代碼示例
- PHP IntlCalendar getActualMinimum()用法及代碼示例
- PHP WHMCS DomainGetWhoisInfo用法及代碼示例
- PHP metaphone()用法及代碼示例
- PHP WHMCS ClientAreaHeaderOutput用法及代碼示例
注:本文由純淨天空篩選整理自whmcs.com大神的英文原創作品 EmailPreLog。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。