Generating Gravatar Image Request URLs
  • 12 Mar 2026
  • Dark
    Light
  • PDF

Generating Gravatar Image Request URLs

  • Dark
    Light
  • PDF

Article summary

Gravatar is a service that allows users to centrally manage their avatar across several websites. Slate makes use of Gravatar in several places, such as the "Dashboard" tab on a person record. It's possible to retrieve a user's Gravatar (e.g., to display in a portal, to merge into a mailing) by passing in a hash of their email address into an image request, which Gravatar outlines here

Generating the Email Hash

  1. Add a subquery export.

  2. Specify a name for the subquery export such as "email-hash".

  3. Set the output setting to "Formula".

  4. Add an export to get the email address.

  5. Enter the following formula into the Formula box, replacing "@Email" with the name of the export you added in the above step:

    lower(convert(varchar(32), hashbytes('MD5', lower(@Email)), 2))
  6. Click save.

Performing the Image Request

We can now use the hashed email address above to perform the image request.

  1. Add an image wherever you want the Gravatar to appear. For example, if you want the person’s Gravatar to appear in the body of a Deliver mailing, open the mailing for editing and click the button to add an image within the text.

  2. Instead of browsing your database server for an image, enter the following URL into the image’s URL setting, replacing "{{email-hash}}" with the name you used in your subquery export:

    https://www.gravatar.com/avatar/{{email-hash}}
  3. If you want to instruct Gravatar to return something if a Gravatar is not found for the hashed email address, you can modify the URL using the d parameter. The below example returns "mystery-person", or gray avatar:

    https://www.gravatar.com/avatar/{{email-hash}}?d=mp
  4. If you want to control the size of the Gravatar, you can modify the URL using the s parameter. The proceeding example builds on the last and sizes the Gravatar to 45px by 45px:

    https://www.gravatar.com/avatar/{{email-hash}}?d=mp&s=45
  5. Click save.


Was this article helpful?