Import Email Id's In Magento Newsletter - magento

I need to import 50k email ids for magento newsletter subscription.I found a tutorial to import, http://www.g31zone.com/?p=187. Is importing 50k email ids through an array is feasible?Is their any other way to import?
Edit
Is it possible to import customer name through this array?
Looking forward for your response!

Here is an extension:
http://www.magentocommerce.com/magento-connect/Jan+Wohlfeil/extension/2358/newsletter-address-import/reviews
Newsletters are in a different table to customers and import quickly.
With 50K subscribers you may want a proper newsletter manager, e.g. one where you can track bounces etc. CiviCRM CiviMail or phpnewsletter should do that for you.

Import Multiple Email Subscribers using .CSV
Create a .CSV file and title two columns subscriber_email and subscriber_status. Ensure these are correct else the import will not work.
Under subscriber_email list all email addresses. Under subscriber_status make sure each field value is 1.
In phpMyAdmin under Newsletter_Subscriber click import. Using the browse function select you .CSV file, ensure it's set to UTF-8 andfile format is .CSV.
Under "format specific options" in the column names filed enter: subscriber_email,subscriber_status.
Click go and all you fields will be imported instantly.
Finally, login to the Magento Control Panel and under Newsletter Subscribers you'll be able to view all the imported email subscribers.
http://www.littlekidsbeds.co.uk

You can add records directly to newsletter_subscriber table, choose correct store_id, customer_id = 0, subscriber_status = 1, subscriber_confirm_code empty.
Alternatively you could create simple PHP script that would use newsletter subscriber model, an example:
<?php
require_once "/path/to/Mage.php";
Mage::app();
$subscribers = array('email1#server1.com', 'email2#server2.com', ...);
foreach ($subscribers as $email) {
Mage::getModel('newsletter/subscriber')->subscribe($email);
}

Yeah go ahead had reset password of 30K customers in the same manner not to long ago :)

Related

Don't show the message to all users? ( laravel )

I need to create to send a message to all new users registered on my website. I created a table called messages that admins can store (insert) the messages from the admin panel to this table and these messages are simply shown to all users with a foreach.
I don't know if this the best way to do something like that!
Anyway, the problem is that when any new user register and open his dashboard he just found the old messages
This is the table :
image
And this is the simple code for foreach
$msgForAll = Message::latest()->get();
I'm not sure how to display new messages to the users.
Again the way I made this idea is wrong, I know that ):
You can use eloquent's where spefically the whereDate queries in your case to get certain rows past or before date.
As an example relating to what you want to do, it can be along the lines of this:
// Given that you are using Auth to get the user's data...
// Get messages that were created after the user's creation date
$messages = Message::whereDate('created_at','>',Auth::User()->created_at)->get();

Magmi: missing products

Whenever I do an import with Magmi, it misses products without telling me what happened.
For example on this screenshot below, you can see it found 226 records but only imported 194 items.
What happened to the remaining 32 items? Can I find their SKU? Why weren't they imported? Is there any place I can find this information?
You likely had some values in the products that halter their import or they contained data that broke the import.
Do the following:
Check
SELECT sku
FROM catalog_product_entity
ORDER BY entity_id
WHERE
sku
IN
(
.. list of skus you're importing commas separated.
)
To get the skus that you've successfully imported.
Set Magmi import delimiter to | (pipe) and use open office when saving csv files and force them to have quotes around each field and be pipe separated to avoid any and all quote and comma issues within your data.
You can enable and configure Magmi report mail notifier. Every time you import products you will receive a report containing the information about the successfully imported and failed to import products skus.To receive the email you need to configure your email id.

Magento import products from Excel sheet

I recently got a Excel sheet for some products with at least 900 new records.
Now the problem is wether I shall type this manually in the backend or create an own import script for this?
I tried it with the existing Import/Export and only selected that fields I would need to create a master template and fill the new data into it.
But that new master template doesn't look like I can use it. There are much much more fields exported then I would need to import.
Is there any other way to import an Excel sheet that isn't really conform to that from magento import/export one?
Use Magmi to import the products :
http://sourceforge.net/projects/magmi/
http://wiki.magmi.org/index.php?title=Main_Page
Make sure your CSV is UTF-8 encoded and in csv format.
Else you will getting loads of errors if you are going to use magmi.
Also study about how to use magmi before starting.
Thanks
I saw your post, here I am happy to share reply from Our Magento team lead:
"One can import data sheet using Magento Import/Export profiles but in this case you would need to convert your excel file to CSV first.
Next step: please change columns names to match Magento product attributes codes.
Required attributes are the following:
store;
websites;
attribute_set;
type;
category_ids;
price;
weight;
sku;
name;
status;
visibility;
tax_class_id;
description;
short_description;
store_id;
another way to get correct CSV template file is to create a simple product and run export profile.
You will get export_produtcs.csv file where you can find all necessary columns."
Hope this helps,
Thank you
Jen Zorina
Itera Research

Export email list parse for newsletter

How do I export the user emails from the database in a fast and easy way. I want the emails in a list so I can send out news letters. Thanks for help!
There's a button in the data browser to export data. I believe this goes to a .CSV file, so you can delete the other columns and then just use a batch email sender to send your newsletter.
OR
Create a program that queries the _User table and takes the email column and creates a .csv file.

Products are not displaying in Frontend after import in Magento

I have imported products using System - Import/Export - Import option.
I can see my products in Admin panel, but not in Frontend.
I tried Re-indexing, cache clear, cache refresh, physical cache remove.
also checked product stock status, availability etc. Everything is ok.
But they are not displaying in frontend. I marked onething, If I open product that I imported using csv, just saved without any change, it starts displaying. But I have 100s of products. So I can't use this solution.
So please help me where I am going wrong in csv. below is my csv screenshot.
You need to ensure that the products are attached to a website.
This can be done via a bulk update:
Access the product listm select all
Alter attribute
Products information -> websites
It can also be done in the csv by using a "_product_websites" field and setting it to the website name or 'base'.
I forgot which CSV columns are mandatory but I do remember that if some are missing the importer does not tell you that but instead you get the behaviour that you are describing.
The simplest way to find out what is mandatory is to:
Fix bugs in Magento ImportExport module
Create a new product in admin
Check that the new product is visible on front-end
Export the new product with Magento ImportExport exporter
Delete created product
Import the previously exported product csv
Clear cache and reindex data
Check that product is visible on front-end (it should be)
Compare your CSV with the exported one and try to figure out what is missing from it
Try to import your CSV with added/fixed columns and add data untill the product is imported so that it is visible on front-end
This requires allot of trial and error...
The missing columns in my case had always the same value so if this will be the case with your problem as well you can simply extend CSV importer and hard code those values in there instead of fixing your CSV manually.
Since your product gets saved correctly if you open it in admin and save it you can also:
Import a product
Export that product
Open that product in admin and save it
Export newly saved product
Compare exported CSV-s where they differ
Fixing Magento ImportExport bugs:
First bug is that if you import multiple products the quantity informatino from the first product is used for all the products. To fix this you have to add $row = array(); right before $row['product_id'] = $this->_newSku[$rowData[self::COL_SKU]]['entity_id']; in Mage_ImportExport_Model_Import_Entity_Product::_saveStockItem() function.
The second bug causes Magento ImportExport module to return a foreign key constraint error when importing multiple products. Error happens because magento splits products data into multiple segments and if one product is located in two segments importer will delete data that was imported for the product in first segment before importing the second segment thereby causing database corruption (see this link for detailed explanation - this is where I got the solution below).
Note that removing foreign key constraint will not fix the problem but will instead make it worse since the database will contain corrupt data.
To fix it you have to change the code in Mage_ImportExport_Model_Import_Entity_Abstract::_saveValidatedBunches() function:
After if ($startNewBunch || !$source->valid()) { add
if ($startNewBunch && count($bunchRows) > 1) {
$arrKeys = array_keys($bunchRows);
$arrNew = array();
while(($tRow = array_pop($bunchRows))) {
$tKey = array_pop($arrKeys);
$arrNew[$tKey] = $tRow;
if ($tRow['sku']) {
break;
}
}
$nextRowBackup = array_reverse($arrNew, TRUE) + $nextRowBackup;
}
Hope this helps.
I had the same problem recently and I spent some time tring to figure it out...
Looks like magento needs a status flag for every product otherwise magento will not show it in the dashboard.
Solution : add a "status" column to your CSV file and set all the statuses to "Enabled"
(yes it's not a boolean. Just use the string inside the quotes as it is :)
I was stuck with the same problem, i then visited my var/export/export_all_products file, downloaded it again and uploaded the same back through import, logged out of my account and logged-in back, all products were back. This worked as a backup for me and i could see all the products back at the back-end.
Import as you have. If they are enabled, but not showing...
then you can fix this by clicking "select all" products in the "manage products" table and then "change status" and then select "enabled." This process might take a minute.
Visit your store and you should see your frontend with products.
Some kind of bug with the status/enabled setting.
You must have next fields in CSV
sku
_attribute_set
_type
_category
description
image
name
price
short_description
status
tax_class_id
thumbnail
visibility
weight
qty
_product_websites
is_in_stock
Please note that field is_in_stock is mandatory even if qty more then 1
In magento 2 we need to reindex in index management to display the products in frontend.
We can reindex through cmd.like the given example we need to enter magento file directory after that cmd php -f bin/magento indexer:reindex to reindex .
When I first started importing products via csv although I set the product to enabled, I figured out that even though it shows in the magento back end as enabled, it actually isnt - think its to do with setting the field contents as "1" or "0" rather than "enabled" or "disabled/null".
To get around this, after a import I simply selected all the products in the back end and change status to enabled - it fixes issue.
But, I do think if I simply changed the data in the csv import it would save me this minor in-convenience.

Resources