Change the picture in gravatar - url with the desired email address

I want to put this under the “change image” link in the user profile. To limit possible errors, I would like to provide the email user used in the profile (thus used in the URL of the picture) so that they do not have to register with the Gravatar service.

I wonder if there is a way to create a URL for modifying / registering a Gravatar image with email already provided.

+3
source share
2 answers

Since there was no better answer here, a 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> 
0
source

, :

  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

user_email . , , Wordpress Gravatar, , , .

0

Source: https://habr.com/ru/post/1779763/


All Articles