add X-sender

flexyflex

New Member
Hello,

X-Sender does not appear in the headers of my emails, how can I add it?
It was there in old versions

Thank you !
 
We removed all headers that have no usage for us.
If you want it, you can add it from the delivery server, you can add custom headers from there.
But keep in mind, it has no benefit.
 
Thank you for your answer
I can add it in the SendCampaignsCommand.php file ? Can I use the custom tags?

thank you
 
I can add it in the SendCampaignsCommand.php file ? Can I use the custom tags?
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;
    });
 
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;
    });
We can't add it in the custom headers from the delivery server, it doesn't work.
X-sender is automatically deleted (others words is ok)
 
Back
Top