Change base URL for email activation link? I am using Craft as a headless CMS and have set base Url/siteUrl to the url of my React/Gatsby site.

I needed to do this as my navigation plugin, Navie, appends it by default.

But now when users registers, they are sent an activation email with the Gatsby url.

How can I change this?

Thanks
You can use a Twig replace filter in the email template to replace the URL with whatever you like. (I'm using this method myself because we have a similar problem on multi-site installs). To do this you'll need to be using custom templates for all system emails: Settings &gt; Email &gt; HTML Email Template

I'd set that to something like emails/index, which could then be like this, routing out to separate template files depending on the emailKey:

{# Craft has four predefined email keys:

    account_activation
    verify_new_email
    forgot_password
    test_email

... route to them here, or fallback to default
#}

{% include [
    'emails/' ~ emailKey ?? null,
    'emails/default'
] %}


Then emails/account_activation.twig could be something like this using the replace filter on the link variable: 

{% extends 'emails/_emailLayout' %}

{% set lockscreenText = 'Activate your account' %}

{%- set heading -%}
    Hi {{ user.friendlyName ?? 'there' }},
{%- endset -%}

{% block content %}
    &lt;p&gt;Your account is now set up and ready to use, with your email address as your username.&lt;/p&gt;
    &lt;p&gt;To activate your account, click the following link:&lt;/p&gt;
{% endblock %}

{% if link is not defined %}
    {% set link = 'http://local.test' %}
{% endif %}
{% set buttonLink = link|replace('https://old.com/actions','https://new.com/actions') %}
{% set buttonText = 'Activate your account' %}


...while emails/_emailLayout would have all the complicated mess of HTML that cross-client email requires.