Import/Export Customer Referrals
Importing Customer Referrals
As of MageRewards 220.127.116.11, administrators can import a list of referrals into Magento by specifying a list of referrers and their referrals inside a CSV file. Instructions below outline how the input file should look like, and how administrators can expect the feature to work.
You may import a list of referrals all in one go within a single CSV file. The first line in your file must specify column headers for the rest of the file. A typical header line will look something like this:
Required headings are:
- referrer_email - This is the email address of the person who invited someone else.
- referral_email - This is the email address of the person who has been invited.
- website_id - If customers are different across your websites, you'll need to provide a website id to locate both the referral and referrer customers.
After the first line, each line of your input file will contain a referrer to referral mapping. On each line, provide a pair of email addresses to be linked together in the same order as your supplied headings. Here's a full example of an input file:
referrer_email, referral_email, website_id email@example.com, firstname.lastname@example.org, 1 email@example.com, firstname.lastname@example.org, 2<br>
In MageRewards 18.104.22.168 and up, you can access the Referrals Import feature from the referrals list page:
hen starting a new import, you must provide a CSV file which conforms to the rules above. There are several options available to you for the import:
- Overwrite existing referrals - This option allows you to ignore a pre-existing referral and re-define it's referrer if you've supplied one inside your import file. This setting does not affect any referrals which aren't in your import file.
- Referrals must have an account - This setting allows you to make sure referrals are pre-existing customers. Alternatively, you may allow referrals to be a future customer. This means that the referral will automatically link to the referrer, as soon as the referrer signs up. Note that referrers must already have a customer account regardless of this setting.
In an effort to optimize for performance and allow for larger import files, the import itself is processed in the background through the Magento CRON system. Once you've scheduled an import, it will start as soon as your next CRON iteration starts. This depends heavily on how your server was set-up and whether or not, the Magento CRON has been activated. If done properly, this happens once every 5 minutes. You'll need to contact your hosting provider if this is not the case.
Once the import is finished, you'll receive a report at the email address you provided when scheduling the import job.
If the import feature doesn't give you the flexibility you need, you can always do this directly through the database with lots of caution of course.
Exporting Customers Referrals
Starting with MageRewards 22.214.171.124 you also have the option to export to CSV / XML your customers referrals, by going to Admin Panel > Rewards > Customer Referrals section and choosing the desired action.
NOTE: If you are you running an older version of Magento (prior to 1.7) and you are using Chrome, you may have a problem exporting the files. This is not a MageRewards issue but a known Magento issue. To get the export to work, you can use one of these recommended work-arounds:
- use a different browser when doing the Export (core Magento or MageRewards Data) (not Chrome)
- Rename the file after the export is done (remove the ending -, attachement from the file name)
- modify the Magento code files (NOT recommended) by following the steps in this article