Jump to content

edit the newsletter csv export file?


Recommended Posts

Does anyone know where the code is for the export of csv files in the newsletter module? I cant find anything anywhere, and theres is no reference to it in the blockNewsletter module???

I need to change what fields are exported in the csv file as the defult prestashop settings dont work with any email marketing software like mail chimp or constant contact.

Link to comment
Share on other sites

  • 4 months later...

OK, then to make it only export the emails, you must modify the newsletter.php file. Can you handle that?

Change this code, around line 112:

private function _getBlockNewsletter()
{
     $rq = Db::getInstance()->ExecuteS('
     SELECT *
     FROM `'._DB_PREFIX_.'newsletter`');
     $header = array('id_customer', 'email', 'newsletter_date_add', 'ip_address');
     $result = (is_array($rq) ? array_merge(array($header), $rq) : $header);
     return $result;
}


to this:

private function _getBlockNewsletter()
{
     $rq = Db::getInstance()->ExecuteS('
     SELECT email
     FROM `'._DB_PREFIX_.'newsletter`');
     $header = array('email');
     $result = (is_array($rq) ? array_merge(array($header), $rq) : $header);
     return $result;
}

  • Like 1
Link to comment
Share on other sites

I find that code very strange because I don't see a table called ps_newsletter in ANY of my installations. v1.25, v1.3.0.1 or v1.3.1.


This is because you do not have the Newsletter block module installed.

I would recommand using OpenOffice Calc (free) instead of Excel to manage CSV files.
Link to comment
Share on other sites

×
×
  • Create New...