Get Started
FunnelKit Documentation
Get unstuck with our helpful reference material

FunnelKit Automations

Resolve the CORS Error

FunnelKit Automations’ new visual email builder allows you to design beautiful emails using pre-designed templates.

It has a WooCommerce product block that lets you offer upsells and cross-sells to your contacts via email.

This product block simply fetches products from a WooCommerce store to use them in emails.

However, sometimes, a website has a strict policy regarding cross-origin, which prohibits the use of product-related data.

This ultimately gives you the CORS error like this:

CORS error

You may also witness such an error while adding images to the email, trying to save a layout, or performing any other action that requires our API call to be fired to fetch the required data from the server.

This error comes from the server’s end, not from FunnelKit Automations. It ultimately impacts your website’s email-building capabilities.

Here are a few steps to resolve the CORS error on your website.

  • Add the following lines to your website’s .htaccess file:
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
</IfModule>

  • In case you don’t have access to .htaccess file, you can easily create one and then add the above lines to start using CORS.
  • In case, you want to define the cross-origin headers in a PHP file, use the following code:
<?php
header("Access-Control-Allow-Headers: Authorization, Content-Type");
header("Access-Control-Allow-Origin: *");
header('content-type: application/json; charset=utf-8');
?>

🔔 Please note that CORS needs to be added to the origin source for the resources to load properly.

We highly recommend sharing this information with your hosting provider team and asking them to perform these steps.

This is how you can resolve the CORS error on your website and effortlessly create beautiful emails.

chevron-down