Set IP address of each subscriber manually

Kane

Member
We're adding subscribers via the API. But the IP address of each is being set to the IP address of our web server, not the actual users/subscribers IPs. So they're currently all the same.

Is there a way to manually set the IP address via the API, without having to use a custom field?
 
You could edit the http client, the __construct method as in:

File: https://github.com/twisted1919/mailwizz-php-sdk/blob/master/MailWizzApi/Http/Client.php#L106
PHP:
public function __construct(array $options = array())
{
    $this->populateFromArray($options);
   
    // this has been added.
    $this->headers['HTTP_CF_CONNECTING_IP'] = $_SERVER['REMOTE_ADDR'];
   
    foreach (array('paramsGet', 'paramsPost', 'paramsPut', 'paramsDelete', 'headers') as $param) {
        if (!($this->$param instanceof MailWizzApi_Params)) {
            $this->$param = new MailWizzApi_Params($this->$param);
        }
    }
}
 
Ok that sounds like a bad solution, as far as upgrades go.

I guess we'll just use a custom field.
 
Back
Top