3

I want to put this under "change picture" action url on the user profile. To limit possible mistakes, I would like to provide an email user used in the profile (thus used in the picture url) so they wouldn't have to while registering to Gravatar service.

I wonder if there is a way to generate an URL to a change/register Gravatar picture with email already provided.

Janusz Skonieczny
  • 17,642
  • 11
  • 55
  • 63
  • oi, that's a tough question to answer because I'm not clear on what you're looking to do. Can you better explain this? – Chase Florell Feb 28 '12 at 22:41
  • A gravatar URL with preset email that will allow user to register and set a picture without having to put their email in the registration form. I'm trying to simplify gravatar change for users that are are confused, as to why change avatar operation moved them to another site, and is asking them for email… again. – Janusz Skonieczny Mar 31 '12 at 11:46

2 Answers2

0

Since no better answer was provided here my workaround:

<form action="http://pl.gravatar.com/accounts/signup" method="post">
  <input type="hidden" name="email" value="name@example.com">
  <input type="hidden" name="commit" value="Get Your Gravatar">
  <button type="submit">Change avatar</button>
</form> 
Janusz Skonieczny
  • 17,642
  • 11
  • 55
  • 63
0

Here is my solution, since this link is often inside another form:

  def gravatar_create_url(user)
     user_email = u user.email.downcase
     "https://signup.wordpress.com/signup/?ref=oauth2&user_email=#{user_email}&oauth2_redirect=bf551c93d83b96478db51481a9cbe97e%40https%3A%2F%2Fpublic-api.wordpress.com%2Foauth2%2Fauthorize%2F%3Fclient_id%3D1854%26response_type%3Dcode%26blog_id%3D0%26state%3D331f9ecba5fcab15e2168e1231f7be2a4b1b8cd24dd6f90b3672fb5159d7b590%26redirect_uri%3Dhttps%253A%252F%252Fen.gravatar.com%252Fconnect%252F%253Faction%253Drequest_access_token%26jetpack-code%26jetpack-user-id%3D0%26action%3Doauth2-login&wpcom_connect=1"
  end

Notice the user_email variable in the query string. I'm not sure about all those other redirect params, as those may change over time with how Wordpress has taken over Gravatar, but hopefully this gets you in the right direction.

toobulkeh
  • 1,618
  • 1
  • 14
  • 22