Uploading your emails to a custom Webhook URL
Emailify includes a built-in Webhook export option, which allows you to send a POST
request contain a JSON payload (below) that includes your email’s name, HTML code, subject line and preheader text.
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 to Webhook URL 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.
src
attribute for any <img>
tags in the html
string property sent via the payload.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>"
}
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.
*
to accept POST requests directly from the Figma plugin instead (without being routed via the proxy server).Was this page helpful?