Posted on

Sneak Peek at the New Magento Gmail/Google Apps and SMTP extension

Wow a month since my last blog post, I’ll have to stop calling this a blog and make it a magazine if these blog posts don’t get more frequent huh?! Anyway, I do have something interesting to report from the world of Magento email extensions, particularly my Google Apps/Gmail extension and my SMTP Pro extension are in for a bit of a shake up.
Continue reading Sneak Peek at the New Magento Gmail/Google Apps and SMTP extension

Posted on

Magento Google Base error: Expected response code 200, got 403 Service forbidden: Account not registered for Google Base

After some initial Google Base problems with Magento 1.3.2.1, I thought everything was going to be fine, only to get whacked with this error: Expected response code 200, got 403 Service forbidden: Account not registered for Google Base. I checked and checked again that my email/password was right, and that the Google account was registered for Google Base.

There wasn’t much help surfacing on Google for it, so I thought now that I have sifted through everything and looked at various sources, I’d compile a bit of an explanation and help guide for it. Please note this only affects 1.3.2.1, it is fixed in the newer versions of Magento, so unless you are wed to your current version, upgrade!

I posted a forum message on the Google Base boards and got this helpful reply:

  • verify the application is not exceeding the api
    limits of approximately 5 requests per second;
  • verify the proper uri is being used for the request.
  • verify all the required attributes and proper values
    are being used for the item-type being inserted —
    check that all the rules for the item-type are being met.

Given my products were not anything special, I doubted the last option. Also given others were reporting success with the Magento Google Base capability (once the initial problem was fixed), I assumed it wasn’t the 5 requests per second problem either. So what was wrong with the request URI?

Well, to cut a long story short, it seems that my problem was due to the account being used for Google Base, also being a Google Apps account. If you’re interested in the details check out the login options for the Google Account API. The hosted Google Apps account did not have Google Base, but the Google account (with the same email and password) did. The login was succeeding, but then the account that was logged-in did not have access to Google Base!

The fix is to tell the GClient API to use the Google account only, not the HOSTED_OR_GOOGLE default. I found others have suggested this fix (or the workaround of using a non-Google Apps account) here.

The gist of it is to change this function call by adding two extra parameters: app\code\core\Mage\GoogleBase\Model\Service.php on line 49. The two parameters to add are: Zend_Gdata_ClientLogin::CLIENTLOGIN_URI, 'GOOGLE' as shown below.

$client = Zend_Gdata_ClientLogin::getHttpClient($user, $pass, Zend_Gdata_Gbase::AUTH_SERVICE_NAME, null, '', $loginToken, $loginCaptcha, Zend_Gdata_ClientLogin::CLIENTLOGIN_URI, 'GOOGLE');

That fixed the problem for me, now I just have to figure out which of the required Google Base attributes I’m missing!

Posted on

New feature for Magento Gmail or Google Apps Email Extension

Just a quick note to say I have added some new functionality to the Gmail or Google Apps email sending extension I wrote for Magento.

Basically several people asked for reply-to functionality, that would use the Magento store addresses that were being used on the outbound email. The change was very minor, I guess I just didn’t see it as being important at the time. Anyway, it’s a configurable option now, so feel free to either use it or not. You can get the extension from Magento Connect.

The change for those interested was very small, just a simple reply-to header as shown below:

// If we are using store emails as reply-to's set the header
if (Mage::helper('googleappsemail')->isReplyToStoreEmail()) {
      $mail->addHeader('Reply-To', $this->getSenderEmail());
}

Also here are some screenshots showing the new configuration option and also how emails sent using the option or not using it.

The Gmail and Google Apps email configuration for Magento is very easy.
The Gmail and Google Apps email configuration for Magento is very easy.

You’ll notice no real changes here, just one new Yes/No option that if enabled will use the reply-to functionality shown below. Basically the reply-to email will be the one Magento is configured to use from the below Store email addresses screen.

This shows an example of some store email addresses configured in Magento
This shows an example of some store email addresses configured in Magento

These are the email addresses you will see in the reply-to field as shown in the examples below.

The default behavior is to send with no reply-to, as it seems the trend is toward automated emails that do not receive responses.
The default behavior is to send with no reply-to, as it seems the trend is toward automated emails that do not receive responses.

This image shows the default non-reply behavior, the from email is used as the to email for any replies.

This shows the new feature, a reply-to field that email clients will use to populate the reply to field.
This shows the new feature, a reply-to field that email clients will use to populate the reply to field.

This screenshot shows the use of the reply-to where Gmail will send the reply to the given email rather than back to the original sender address.

If you have any questions, feedback etc I’m always keen to hear it so please comment or contact me directly.