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.

Your images will automatically be uploaded to our CDN and included as the src attribute for any <img> tags in the html string property sent via the payload.
Your code will be exported as the default HTML option, so if you need the code to be exported for a certain email marketing platform destination (which you’ll handle in your own function), you can optionally select a platform specific option in the Webhook export options panel.

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.

Enabling the Use Proxy setting means that the requests routed through the proxy server will come from a dynamic IP address each time a request is sent, so if you need a static IP address (eg. you’re only allowing incoming requests from certain IPs, like a range of IP addresses in your office network), you should turn this setting off and update your Webhook function to set Access-Control-Allow-Origin to * to accept POST requests directly from the Figma plugin instead (without being routed via the proxy server).

Upload image assets to your own cloud storage bucket

By default, when you use the Custom Webhook URL export option, Emailify will use the Emailify CDN (content delivery network) to host your images for you, but you can optionally swap this out to use your own AWS S3 or Backblaze B2 bucket instead.

Once you select the image hosting service you’d like to use, you’ll need to enter your bucket credentials and details below, which will automatically upload your image assets to your own bucket (and use your bucket image path in the src attrbutes of your HTML <img> tags) during the export process:

  • Access Key
  • Secret Access Key
  • Bucket Name
  • Bucket URL
Please ensure any buckets you create are set to Public access view permissions, otherwise the uploaded image URLs won’t be accessible when the HTML email is sent out