admin管理员组文章数量:1434922
I am looking for the files which are responsible for sending the email in WP e-commmerce, because i need to set the x-priority header = null
I already tried a general function in functions.php
add_filter('phpmailer_init','update_priority_mailer');
function update_priority_mailer($mailer){
$mailer->Priority = '';
return $mailer;
}
but that didn't work
EDIT
I see line 911
$result .= $this->HeaderLine('X-Priority', $this->Priority); in wp-includes\class-phpmailer.php
might be the one that i need to alter. But as i don't want to edit WP source files how can i filter this??
EDIT2
Above function did filter the X-Priority but mail-tester still gives the warning
1.6 XPRIO Has X-Priority header *
Searching where this X-Priority comes from?
I am looking for the files which are responsible for sending the email in WP e-commmerce, because i need to set the x-priority header = null
I already tried a general function in functions.php
add_filter('phpmailer_init','update_priority_mailer');
function update_priority_mailer($mailer){
$mailer->Priority = '';
return $mailer;
}
but that didn't work
EDIT
I see line 911
$result .= $this->HeaderLine('X-Priority', $this->Priority); in wp-includes\class-phpmailer.php
might be the one that i need to alter. But as i don't want to edit WP source files how can i filter this??
EDIT2
Above function did filter the X-Priority but mail-tester still gives the warning
1.6 XPRIO Has X-Priority header *
Searching where this X-Priority comes from?
Share Improve this question edited Jun 15, 2020 at 8:21 CommunityBot 1 asked Jan 5, 2016 at 10:15 alexalex 1,1123 gold badges17 silver badges39 bronze badges1 Answer
Reset to default 0Its looks like you are trying to set a header propery which already been used to create header.
So what I would suggest is set the property and then call the createHeader()
function so now again when building header your changed property should work.
You don't have to use filter
you can use the action
hook itself as the action is refernce
to the gobal phpmailer
Example
add_action( 'phpmailer_init', 'update_priority_mailer' );
function update_priority_mailer( $phpmailer ) {
$phpmailer->Priority = 5; //can be 1, 3, 5
//now again construct the header so the change property will be used
$phpmailer->createHeader();
// since $phpmailer is an reference variable everything will be updated
}
You can also check other methods addCustomHeader()
本文标签: How to set xpriority headernull while using plugin WP ecommerce
版权声明:本文标题:How to set x-priority header = null while using plugin WP e-commerce? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745637946a2667674.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论