在记录电子邮件之前运行。
参数
变量 | 类型 | 注意 |
---|---|---|
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。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。