You don't need to modify core files to do this. Add it from the delivery server settings, you have an area there to add custom headers.I can add it in the SendCampaignsCommand.php file ? Can I use the custom tags?
<?php
Yii::app()->hooks->addFilter('console_command_send_campaigns_campaign_custom_headers', function($headers, $campaign, $subscriber, $customer, $server, $emailParams){
$headers[] = ['name' => 'X-Sender', 'value' => 'whatever'];
return $headers;
});
We can't add it in the custom headers from the delivery server, it doesn't work.You don't need to modify core files to do this. Add it from the delivery server settings, you have an area there to add custom headers.
And yes, some tags are available.
If you need it more custom, you can do it via hooks, there's a hook called console_command_send_campaigns_campaign_custom_headers which you can use, in apps/init-custom.php:
PHP:<?php Yii::app()->hooks->addFilter('console_command_send_campaigns_campaign_custom_headers', function($headers, $campaign, $subscriber, $customer, $server, $emailParams){ $headers[] = ['name' => 'X-Sender', 'value' => 'whatever']; return $headers; });
If you use X- then try to add X-Sender, does that work?I have a customer prefix X-NB-