The 7.x-2.x version of this module did not work for us out of the box. We kept getting a "Dashboard: Unauthorized" error message back from Elastic Email. Tried regenerating our API key, double-checked the email on the account, still no joy.

With a few tweaks to how the POST call to the Elastic Email API was made, I was able to get it working.

I will add a patch to this thread with the fixes that resolved our issue.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

msupko created an issue. See original summary.

msupko’s picture

Attached is a patch that resolved our error authenticating with the Elastic Email V1 API.

The main changes are:

1. Include Content-Type: application/x-www-form-urlencoded header.
2. Switch to using drupal_http_request().

I'm sure the former method of fopen + stream_context_create() was working for many users, but it would not work for us. (We just opened our account in April 2017, so I'm guessing something is different about it from older accounts.)

mike.davis’s picture

Hi @msupko,

Thanks for using this module.

The use of the context_stream was the original suggested way of making the API requests on the Elastic Email site when the module was first created. The patch looks fine from initial look through, but I'll have a look at this patch in more detail.

In the past 6 months or so Elastic Email have released their own set of classes for handling the API calls, which I have been integrating into the D8 release (which is in beta), so I will be looking at up dating the D7 version to use this as well, which should then work for you as well.

Thanks
Mike

mike.davis’s picture

Status: Active » Needs review
mike.davis’s picture

Status: Needs review » Reviewed & tested by the community

Hi @msupko, I have tested this and this works fine, so I will get this committed now :)

  • mike.davis committed 71dd9d8 on 7.x-2.x authored by msupko
    Issue #2870430 by msupko: Unauthorized: Dashboard error when sending...
mike.davis’s picture

Status: Reviewed & tested by the community » Fixed

This has been committed now

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.