PDA

View Full Version : Iterate customers


Brian Roisentul
10-04-06, 03:20 PM
Hello,

I'm new at MIVA, and I just wanted know if anyone can tell me how to iterate my customers list, so I can display their e-mail adresses on a page.

I've already tried using this syntax but didn't work:


<mvt:foreach iterator="customer" array="customers">
<p>&mvt:customer:login;</p>
</mvt:foreach>


Thanks,

Brian

wcw
10-04-06, 04:19 PM
There is no array of "customers" on a standard page in merchant. Even if there were, you would not want any of your customers to stumble across a page where all customers email addresses were displayed.

Brian Roisentul
10-04-06, 04:33 PM
Hi wcw,

Thanks for your quick response.

It would be a "hidden page" so only me can access it.

I want this page to work as a customer list, so I can make a "customer mailer" program by accessing to their e-mail accounts, due MIVA Mailer has not been released for Merchant 5 yet.

Vic - WolfPaw Computers
10-04-06, 04:57 PM
No, but Scot's Mailing List 3 (http://tinyurl.com/fm9f2) has.

Be careful, make sure your privacy policy clearly states you will be soliciting customers who have purchased from you.

Just because they bought something, does not give you the right to market to them without their express permission.

That is an often made mistake store owners make that wind up getting their mail servers blocked for spamming.

Brian Roisentul
10-04-06, 06:06 PM
Ok, thanks for the answer!

Reading documentation, I found a way to get my customers list from the 'customers.dbf' file, writing miva code.

I read a bit about accessing to MIVA databases, but I can't understand it very well :( .

I've tried something like this:

<MVOPEN NAME="plaindb" DATABASE="customers.dbf">

<MvQUERY NAME="cust_emails" QUERY="{ 'SELECT Pw_email FROM customers' }">

(I want to get the Pw_email field only)

Can anyone help me to write a correct MvQuery please :)?

Thanks,

Brian

dotCOM_host
10-04-06, 06:39 PM
Just because they bought something, does not give you the right to market to them without their express permission.
Actually, the law states that if you have any prior business relationship, you are in fact allowed to solicit business from your customers.

There are some requirements on what constitutes the initial email solicitation - you are allowed to send a one-time notice 'inviting' them to be on your list, you have to explain why they are getting email from you, and give them the option to opt out from any such mailing lists.

Of course, you have to give ALL people on your mailing list the option to opt out at any time and unsubscribe with as little effort as possible (ie: no AOL style "send us a notarized letter signed in your firstborn's blood collected during full moon"). Most mailing list programs have a provision for including a simple link you can click on to unsubscribe onself. And of course one should never buy, rent, borrow or lease a mailing list from someone else, no matter how 'legitimate' that transaction may sound, or harvest email addresses from the web or other sources - as those people most certainly would not have been your prior customers and without established prior business relationship, you would be indeed spamming people - something that can get your account terminated by your host without much or any warning.

Also - check your local laws for what constitutes spam. In the US you are allowed to do this type of initial invite to previous customers and rely on "opt out" mechanism afterwards. In other countries they are a lot more strict and everything has to be explicit "opt in." The above comments apply to US laws only (CAN SPAM Act, etc).

Vic - WolfPaw Computers
10-04-06, 06:59 PM
Only if they have been so advised you will be doing so.

It is not ethical to blindly email your customer list with ads and marketing materials when they have not specifically been informed you will be doing so, nor give them the option to opt out of such mailings.

Brandon MUS
10-04-06, 11:04 PM
DBF's can also be opened in Excel a lot of the times. Importing and deleting the cols is very easy to do.

Vic - WolfPaw Computers
10-04-06, 11:12 PM
While this is true in SOME cases, this is a very poor option and I do not recommend you do so.

Excel will not properly handle memo fields and any database that has a memo field will be rendered useless should you edit it this way.

You are much better off simply using a DBF editor.

Brian Roisentul
10-05-06, 02:29 PM
Do I have a way to work with database's records from MIVA directly?

Thanks,

Brian

Vic - WolfPaw Computers
10-05-06, 05:53 PM
If your store is running a MySQL backend, then yes you can use PHP or a standard query to the database.

Brandon MUS
10-05-06, 06:39 PM
phpmyadmin also has a feature of bookmarking queries so you can create mini programs in there if you like.

Brian Roisentul
10-05-06, 07:31 PM
Thanks for your responses, but the store is not running MySQL, its running MivaSQL.

Any ideas to suit this scenario?

Thanks,

Brian

Vic - WolfPaw Computers
10-05-06, 07:37 PM
Kind of a waste to run MM5 without MySQL :(

There really is no good way to interact with mivasql .dbfs other than through MIVAScript.

Brian Roisentul
10-09-06, 02:38 PM
And how would that be like? Cause I've been trying but I can't get it...

I mean, open a connection to the file with the MvOpen tag and then I'd have to iterate the customers and read each email field, but I can't make it works :S.

Could anybody help me?