Magento Smtppro Gmail Issue Solution

If you Magento site has stopped sending emails via SMTP Pro then you will want to have a look in your exception log - var/log/exception.log If you see messages in there along the lines of 2016-10-04T14:27:52+00:00 ERR (3): exception 'Zend_Mail_Protocol_Exception' with message '5.7.14 <https://accounts.google.com/signin/continue?AKgnsbu- 5.7.14 Abc123Abc123Abc123Abc123Abc123Abc123Abc123Abc123Abc123Abc123Abc123Abc123 5.7.14 Abc123Abc123Abc123Abc123Abc123Abc123Abc123Abc123Abc123Abc123Abc123Abc123 5.7.14 Abc123Abc123Abc123Abc123Abc123Abc123Abc123Abc123Abc123Abc123Abc123Abc123 5.7.14 Abc123Abc123Abc123> Please log in via your web browser and 5.7.14 then try again. 5.7.14 Learn more at 5.7.14 https://support.google.com/mail/answer/78754 103sm1699291ioi.29 - gsmtp ' in /var/www/vhosts/www.domain.com/public/lib/Zend/Mail/Protocol/Abstract.php:431 Then the solution is to log into the gmail web interface, but via your server’s IP address. Read On →

Adding new less imports in Magento 2 in Development mode

Importing a new less file when extending a Magento theme needs a few steps: Create the new file in your theme (in the app/design/frontend/<vendor>/<theme>/web/css/source/ folder) Add an import directive for that file in your normal _extend.less file with //@magento_import '_newfile.less'; (yes, with the // - see here) For development mode, build the files using the grunt exec command†. This creates symlinks in your pub/static/frontend/<vendor>/<theme>/<locale>/css/source/ folder For production mode, build the files using the bin/magento setup:source-theme:deploy command. Read On →

Using Mysql Dump to Create Fixtures with Where Conditions

When running unit tests it is generally advisable to have a test database that has a limited but known set of data. The idea is that before each test run, the test database is recreated. So that this process is not too slow we then tend to use a small subset of the real live database - perhaps 100 records or entities rather than however many are on the live site. Read On →

Google Apps Review blocked sign-in attempt problem and solution

When using SMTP Pro’s Self Test function against our development Google Apps inbox, I noticed it repeatedly blocked outgoing emails, with the slightly cryptic error “5.7.14 Please log in via your web browser and 5.7.14 then try again” I logged into the inbox to find an email with the subject “Review blocked sign-in attempt” telling me I was using “an app that doesn’t meet modern security standards”. I’m not sure what these modern security standards are (it talks about them here) but lo and behold all of Google’s apps are apparently compliant. Read On →

Magento 2 - Creating a New Blank Template Block

If you want to insert some custom HTML into a page in Magento 2, you’ll need to add some layout XML and a template file. The equivalent in Magento 1 is a <block type="core/template" template="path/to/template.phtml" name="block_name" /> In Magento 2 you achieve this by adding a <container> in your default.xml (or other layout file) with the following: <referenceContainer name="container_name"> <!-- the name of the container you want to insert into --> <container name="new_container" htmlClass="container_css_class" htmlTag="div"> <block class="Magento\Framework\View\Element\Template" template="Magento_Theme::path/to/template.phtml" name="block_name" /> </container> </referenceContainer> Then create a template in app/design/frontend/<your_vendor>/<your_theme>/Magento_Theme/path/to/template.phtml Remember to flush all caches.

Php Cli Progress Bar

I’ve been doing a lot of data manipulation on the command line recently, and one of bugbears that I ran into was that my commands gave no indication of how long they were going to take to complete. Sick and tired of just looking at the blank screen I put together a small progress bar class that can be used indicate how many items have been processed. class ProgressBar { protected $_spinners = ['|', '/', '-', '\\', '|', '/', '-', '\\']; /** * This is used to echo the progress of a task on the command line. Read On →