PrestaShop Forums: edit the newsletter csv export file? - PrestaShop Forums

Jump to content


Welcome to the PrestaShop Forum! We hope you'll share your comments and suggestions with us. We ask that you please post in English to the main sections of the PrestaShop Forum. If you want to write in another language, please post in the corresponding PrestaShop Community section below.

Please note that PrestaShop Community sections are largely self-moderated. PrestaShop team members may or may not participate in non-English sections. To improve the chances of receiving feedback to your question or comment, please post it in English to the main sections of our Forum.

NYC

Vous parlez français ? par ici !


edit the newsletter csv export file?


edit the newsletter csv export file?

#1 Lpeek

    PrestaShop Newbie

  • 18 Oct 2009
  • Members
  • Pip
  • 19 posts

Posted 21 March 2010 - 02:05 PM

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.
Trashy Art - Handmade Kitsch Jewellery from the UK.

#2

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 22 March 2010 - 12:43 AM

The _getBlockNewsletter function in modules/newsletter/newsletter.php gets the newsletter data and the _postProcess function writes the CSV file.

#3

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 03 August 2010 - 12:55 PM

I am sorry for bringing up this old topic, but I want to modify too..

But I have NO clues about PHP, sorry.

I want to have the output list of ONLY email addresses and nothing else.
I use Eudora and I have yet to figure out how to import things there. I only get one box that asks for PST files.

#4

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 03 August 2010 - 01:17 PM

If you want to export the e-mails of the regitered persons, you can use the dedicated module :
Back Office >> Modules
Newsletter (section Tools)
Configure >>

#5

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 03 August 2010 - 02:14 PM

But that's what I am doing, and the result file contains fields I do not wish to be there, I just want a file with email addresses only, no other data. (such as name, date, ip )

#6

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 03 August 2010 - 02:32 PM

Geez man, it's a CSV file, open it in Excel and remove the fields you don't want, then save it again.

#7

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 03 August 2010 - 02:44 PM

I don't have Excel installed.. :P

#8

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 03 August 2010 - 02:57 PM

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;
}


#9

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 03 August 2010 - 02:59 PM

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.

#10

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 03 August 2010 - 03:04 PM

Thank you for your help.

#11

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 03 August 2010 - 03:07 PM

From 1280843968:

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.

#12

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 03 August 2010 - 03:09 PM

Well, I thought we did but, whatever...Thanks.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users