Jump to content

Recommended Posts

Posted

Hello, 
i have some uderdata that i need to import to mailchimp or something else. 

How can i create with the api an xls or cv file ? This is simple data like name surname email an newsletterstatus. 

 

Posted

The CSV format is so simple you can easily create a template to generate the right output. As an example:

<?php
header('Content-Type: text/csv');
header('Content-Disposition: attachment; filename="export.csv"');

$items = $pages->find("template=basic_page");
echo "title,url" . PHP_EOL;
foreach($items as $item) {
    echo "\"$item->title\",\"$item->url\"" . PHP_EOL;
}

 

  • Like 10

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...