You might have noticed that while exporting client list (to import in Mailchimp or any other email marketing tool you might be using), there is no way to filter the client list on the basis of their "Email Optout Status" as there is no filter for this service. As the report php files are not encoded, you can always modify them to suit your needs. Here, I have modified the file `/modules/reports/clients.php` to add the Email Opt Out filter so you can export only the clients who have opted in for marketing emails.
To do this, just copy the clients.php file and rename it to something like "clients-marketing.php". Then edit the following code on line 8 :
$filterfields = array("id"=>"ID","firstname"=>"First Name","lastname"=>"Last Name","companyname"=>"Company Name","email"=>"Email","address1"=>"Address 1","address2"=>"Address 2","city"=>"City","state"=>"State","postcode"=>"Postcode","country"=>"Country","phonenumber"=>"Phone Number","currency"=>"Currency","groupid"=>"Client Group ID","credit"=>"Credit","datecreated"=>"Creation Date","notes"=>"Notes","status"=>"Status");
to
$filterfields = array("id"=>"ID","firstname"=>"First Name","lastname"=>"Last Name","companyname"=>"Company Name","email"=>"Email","address1"=>"Address 1","address2"=>"Address 2","city"=>"City","state"=>"State","postcode"=>"Postcode","country"=>"Country","phonenumber"=>"Phone Number","currency"=>"Currency","groupid"=>"Client Group ID","credit"=>"Credit","datecreated"=>"Creation Date","notes"=>"Notes","status"=>"Status","emailoptout"=>"Email Optout");
That is it. Do not forget to update the report title (on line 6) to a title of your liking. Once the changes are saved, you will see a new report on the Reports page with the title you selected on line 6.
Hope it helps. If required, feel free to customize it as you need.