HummingbirdUK main logo

Coding solutions to business problems

About us

We use code to create solutions to business challenges, bottle-necks and headaches.

If you think your business has a problem that can be solved through code, we are happy to chat things through without any obligation.

Get in touch

Confirm new Magento customer

Home / Blog / Confirm new Magento customer

Written by Giles Bennett

A recent head-scratcher for a client cropped up when their customers were receiving repeated confirmation emails on signing into their accounts.

They had an interesting set up - customers couldn't create accounts through the website, instead new customers were created in their CRM, and then uploaded to a CSV on the site nightly - that CSV was then processed by a script in Magento which would review each customer and create them a new account, then email them a welcome email with their new account details.

The configuration settings in Magento didn't require customers to confirm their email addresses, but even though the script looked like it was setting the customers as confirmed, they weren't being confirmed when created in the system.

There are two things to bear in mind :

1. The customer entity has a confirmation attribute which has a value only if the customer hasn't been confirmed. Since creating a customer programmatically over-rides what the configuration may say about confirmation, therefore, one would need to set the customer as confirmed, passing a null value, to mark them as confirmed in the database.

2. It's necessary to save the new customer before and after doing this - so having set all the other information about the new customer, one would then save, set them as confirmed, then save again, like so :


And that's it. No more confirmation issues. Hope that helps someone.

Author : Giles Bennett

About the author

Giles Bennett built his first website in 1996, and is old enough to miss Netscape Navigator. Initially a lawyer, he jumped ship to IT in 2008, and after 5 years as a freelancer, he founded HummingbirdUK in 2013. He can be reached by email at