Error from API: "a is not a valid status for member ### with current status o"

  • 0
  • 2
  • Question
  • Updated 4 years ago
  • Answered
I'm testing the API, specifically updating a member's subscription preferences (http://api.myemma.com/api/external/me...).

I'm able to create a new member and set the member's status to opt-out, but I can't switch it back. When I do I get the following error:

"a is not a valid status for member 336875713 with current status o"

If I was able to set the status to "o" why couldn't I switch it back to "a"? Is there another endpoint I should use instead of PUT /:account_id/members/:member_id?

Should I be using a different status (other than "o") to turn off emails for the members? Or should I just be deleting the members instead of setting the status to "o"?

Thanks.
Photo of Brian Ecker

Brian Ecker

  • 6 Posts
  • 1 Reply Like

Posted 5 years ago

  • 0
  • 2
Photo of Katie Lewis

Katie Lewis, Official Rep

  • 3414 Posts
  • 309 Reply Likes
Official Response
Hi Brian! You aren't able to change someone from Opt-Out status to Active using the API for the same reason you can't do this within your account: We have to protect the person who has chosen to opt out of your emails.

There are four ways someone who has opted out can be changed back to Active, but you aren't able to do this using the API.
You can continue using the o status to opt someone out of receiving your emails -- just know that they'll have to choose to opt back in. You can delete them if you want to remove them entirely from your view, but it isn't necessary.

However, you can undelete members yourself without waiting on the action of those members. So whether you opt someone out or delete them depends on your expectation down the line -- whether they'll want to rejoin your list (requires action on their part) or you want to add them back to your audience to send to them (by undeleting them).

I hope this helps, Brian, but let me know if you have any other questions!
Photo of Brian Ecker

Brian Ecker

  • 6 Posts
  • 1 Reply Like
Hi Katie,

Thanks for your reply. I just want to clarify: this rule applies even though the user's opt-out status was set via the API? I understand the reasoning behind opt-out when triggered through an email link flow, but it just seems strange that the API status change is one-way. Is there a lightbox, iframe, popup window, API call, or other direct URL I can launch to start the opt-in flow?

Thanks!
Photo of Katie Lewis

Katie Lewis, Official Rep

  • 3414 Posts
  • 309 Reply Likes
That's right, when someone's status is set to Opt-Out, even if done via the API, that move to Opt-Out can't be changed without that person's action. I'm sorry for the inconvenience!

It sounds like you're looking for a signup form to send them to get them to opt back in -- Is that right? If so, you can grab the URL for your signup form and send it their way. Go to your Audience page, scroll down to the bottom, click the downward-pointing arrow to the right of your signup form and click Add this to your site. Then, copy the URL in the Link to it field, and that's what you'll send them.

Let me know if I'm not quite hitting upon what you're asking, and I'll keep digging!
Photo of Brian Ecker

Brian Ecker

  • 6 Posts
  • 1 Reply Like
Yes, I think the signup form will work. Is there any way I can prepopulate the email address input, and preferably disable edits to it?

I should clarify what I'm trying to accomplish. We are trying to centralize the various email subscription options on our website, so a user only needs to visit one page to manage all their newsletter, activity notifications and account management communications.

We already know the user's email address (they used it when they registered) and we want to make sure the user isn't managing someone else's subscription from their account.
Photo of Katie Lewis

Katie Lewis, Official Rep

  • 3414 Posts
  • 309 Reply Likes
There isn't a way I know of to prepopulate the email address and make it uneditable using an Emma signup form, but it might be possible using a form you've built on your own and connected to your account using our API. I can't speak to how to do that, though, since we aren't coders and don't provide support for the API; I just know it isn't possible using an Emma form.

One option for opting back in where the email address is prepoulated is if the user finds a previous Emma campaign of yours in their inbox and clicks the footer link to manage preferences. When they do that, their email address is automatically there -- but it is editable.

You're right that if you send bob@company.com a link to your signup form, he could enter katie@company.com into the Email Address field and add me to your list. However, if he adds katie@company.com and that address is in Opt-Out status, the only way katie@company.com will start receiving emails is if I click the link in the email I receive to opt myself back in. So there is a bit of a safety net there.

Now, that being said, katie@company.com would be added to your audience if it weren't in Opt-Out status. I haven't heard of cases of this happening, where someone enters an email address that isn't their own. Are you concerned that this might be happening among your subscribers?
Photo of Brian Ecker

Brian Ecker

  • 6 Posts
  • 1 Reply Like
Ah, I see, so if I call the POST /:account_id/members/signup endpoint in the API with the email address of a user who had opted-out it will trigger the opt-in flow and send the user a confirmation email? That will work just fine.

I'm not too worried about users opting in other users, although audit logs would be helpful to track if such a thing were happening. I'm more concerned about minimizing the friction in the user experience. Thanks for your prompt responses!
Photo of Katie Lewis

Katie Lewis, Official Rep

  • 3414 Posts
  • 309 Reply Likes
Yep, you're right, you can trigger the workflow using the signup call. :)
Photo of Luciano Ziegler

Luciano Ziegler

  • 1 Post
  • 0 Reply Likes
I'm having the same problem. If I mark user as opted-out via api or user clicks on unsubscribe link on an email, there's nothing I can do to change user's status back to active.

I tried doing as @Katie suggested via POST /:account_id/members/signup api but it doesn't work. User never receives an email asking to opt-in.

I also tried removing and re-adding user via api, no luck there. Once user is opted out I can't remove it via api.

The workflow I'm trying to achieve is:
- User goes to our website and changes email option to:
- "subscribe": User is added to emma list via api (even if user has unsubscribed in the past)
- "unsubscribe": User is removed from emma list via api

How can I accomplish this?
Photo of Benton Cummings

Benton Cummings, Senior Manager, Customer Support

  • 491 Posts
  • 52 Reply Likes
Hi Luciano,

Unfortunately, there won't be a way to trigger the opt-back-in events via the API. The contact will ultimately need to be the one taking the action to opt-themselves back in, per Katie's recommendations above. Here are the ways that could happen again in case you needed them.

Thanks!!