Skip to content

Uploading your emails to a custom Webhook URL

In the Emailify export panel, select the Custom Webhook URL option from the dropdown list, then paste in your own custom URL endpoint that has been created to handle the JSON payload sent from Emailify.

When you're ready, click the POST button to start exporting the emails you've selected from Figma to HTML, and have them automatically sent as a POST request to your custom webhook endpoint.

The JSON payload object sent via POST to your URL โ€‹

The JSON payload sent from Emailify contains the object keys/values below; you'll need to ensure that your custom webhook URL has been created to handle this payload, which you can then use however you like.

{
  "name": "Name of the Figma frame",
  "subject": "Subject line set in Emailify settings",
  "preheader": "Preheader text set in Emailify settings",
  "html": "<html><head></head><body>Exported email HTML</body></html>"
}

Adding custom JSON body and headers to your payload โ€‹

You can optionally add your own valid JSON string to the input fields below, and those will automatically be included in your payload's header object and/or data body object that's sent to your endpoint URL from the plugin as a POST request:

  • You can set custom header object properties via the Custom Request Headers (Optional) field (eg. { "Authorization": "Bearer xyz" })
  • You can set custom body data object properties Custom Extra JSON Data (Optional) (eg. { "category": "emailify" })
  • Or, you can also set custom body data object properties on a "per-email" basis in the Extra Email-Specific JSON Payload Data (Optional) (eg. { "id": 26, "tag": "email", "edit": true }) field under any email(s) in your export panel list, which will be merged with any global JSON data you may have already set globally (above).

POST your JSON payload via a proxy server โ€‹

As Figma plugins are run inside of a sandboxed iFrame element in the Figma app, it doesn't have any origin, so your Webhook URL that you POST the JSON payload to may reject the request due to cross-origin CORS issues.

To work around this, you can either update your own Webhook function with Access-Control-Allow-Origin set to * (all), or you can enable the Use Proxy toggle (which is turned on by default) in the Emailify plugin settings when you're exporting your email to a custom Webhook.

Enabling the Use Proxy toggle with autoamtically route your request through a proxy server before hitting your Webhook URL, to ensure that the incoming POST request has an origin and should resolve any CORS issues. This is purely a forwarding request, so the JSON data will flow directly through the proxy, and forwarded on straight to your own Webhook URL.