Netlify Identity not using custom email templates

We’ve created custom email templates, and hooked them up using the Netlify UI at configuration/identity#emails. Netlify CMS does not use these emails. We still get the default emails that do not contain /admin in the URLs when attempting a password reset for our CMS users.

We are logging in to the CMS with Netlify Identity.

Is there another configuration somewhere for the CMS, that will tell it to use the same custom emails that are defined here? (My best guess is that these emails were intended for logging into app.netlify.com?)

@jenlampton I suspect you’re speaking about an existing Netlify CMS installation, and you’re likely already aware, but Netlify CMS became Decap CMS:

You should seek CMS support with them directly:

You may also be interested in these other alternatives (you’ll need to expand or click on the post to see them):

Does this mean the documented solution of hooking up the new email templates via configuration/identity#emails isn’t supported anymore, do you know?

I will open an issue in GitHub also, but since this interface obviously isn’t available to people who aren’t on Netlify I had thought this would be a better place for this question.

@jenlampton I can’t advise much as I never worked with Netlify CMS.

You’re definitely not wrong for asking questions concerning it here, I just know that it languished for a time before being handed over to PM, rebranded as Decap, and that support for it is very thin.

There are no references to “Netlify CMS” in the current documentation that I can spot.

There are references to Decap:
https://docs.netlify.com/security/secure-access-to-sites/identity/

But that references Git Gateway which is a Beta feature:
https://docs.netlify.com/security/secure-access-to-sites/git-gateway/

1 Like

This is the documentation for custom emails that I was referencing:

I’m not sure where or how they are normally triggered, but we are only using them for the CMS in our setup.

I just realized that I can trigger a pw reset email directly from the Identity interface, and I still don’t get the custom message, so maybe my problem doesn’t have anything to do with the CMS at all?

@jenlampton I understand you’re talking about Netlify Identity, but it’s not a CMS specific feature.

I personally have no knowledge of how the two integrate, it’s likely that Netlify CMS just leaned on Netlify Identity and thus you’re not wrong to follow that documentation.

I just can’t say, having never used either.

The Decap community are probably quite familiar with both, especially if Decap or legacy installations lean on Netlify Identity.

Ultimately I’m just saying, you should probably ask someone there, as you may get a faster answer.
(That doesn’t preclude someone else wandering along here that did work with Netlify CMS and can answer you properly. - I just know I can’t answer you properly, but that Decap likely can)

1 Like

Thanks for all the help @nathanmartin I’ve opened an issue with decap:

@jenlampton Great, hopefully they can help you.

Their community page indicates that there’s also a Discord and GitHub Discussions:

@jenlampton, this would be Netlify-issue, sorry for the confusion here. With that being said, the templates don’t work because they do not exist: vitalsigns-staging.netlify.app/email-templates/invitation.html (that’s one of the URLs to the templates)

Do these email templates need to be publicly accessible over the web? I thought it was going to pull them from our GitHub repository.

@jenlampton The Identity-generated emails ‘Custom templates’ documentation is here:

It says:

You can customize the Identity-generated emails by creating new templates and publishing them to a path on your deployed site, then specifying the path to the template file (relative to the site domain, starting with a / ) in Site configuration > Identity > Emails.

It indicates they need to be published to a path on the deployed site.

Unfortunately having the email templates public over the web does not seem to solve the problem. Here is my password reset email template: https://vitalsigns-staging.netlify.app/email-templates/password-recovery.html

Even with that visible to the world, it does not seem to be visible to Netlify Identity. Most of the time the email arrives instantly, but always with the default email copy, which is missing the /admin that will make the reset process work.

I have tried adding the “path to template” in various possible ways. 1) with the leading / as in the placehodler text, 2) without the leading /, 3) including the github path to the docroot.

@jenlampton Regarding the paths, the documentation previously quoted says:

specifying the path to the template file (relative to the site domain, starting with a / ) in Site configuration > Identity > Emails.

So I’d expect it to be /email-templates/password-recovery.html

I do note that the site itself is password protected, I’m not sure if that would impact it.

If the templates are retrieved at execution time from the public URL, I wouldn’t be surprised that it receiving a 401 status would cause the default templates to be sent.

You could test yourself or wait for @hrishikesh to clarify if the custom email templates and password protected site features play nicely together.

I did read the documentation before I started trying anything at all - but since it still isn’t working as documented, and becasue I had an unconfirmed “working example” of custom email templates without the leading slash, I’ve been trying it that way also.

We definitely shouldn’t remove the password protection on this staging site, so I certainly hope that’s not going to be an issue.

@jenlampton I’m not saying you haven’t read the documentation or done anything wrong, I’m just giving my interpretation of what I’d personally expect to work based on what Netlify have written.

Netlify will be able to confirm that, again I’m just giving a guess as to what it might be with my limited visibility, and the view that if it was something you could temporarily turn off to test, that it would be something you confirm yourself faster than waiting for a Netlify support response.

If you can’t turn it off, that’s fine too, then you just wait.

Gotcha, thank you. I appreciate your quick responses.

I have disabled/enabled password protection on the whole site, and I got the correct email template immediately when PW protection was turned off. That’s a pretty clear sign that your instincts are correct @nathanmartin. Unfortunately, we don’t want to disable PW protection on this staging copy of our site for various reasons.

Since we are forced to make email templates publicly available over the web - they will also be available on our live site now – and that’s not password protected. I wonder if there is a way we can use those public templates for this staging instance, or if the relative path is important for some reason.

Templates can only be relative to the current site.

@hrishikesh do you know if having custom email templates with a password protected site is impossible?

Yes, the template needs to be publicly available. Password protection blocks it from being accessible.

Thanks. If the documentation had included the fact that custom email templates are not compatible with password protected sites (two “features” that seem to have nothing to do with one another), it would have saved us hours of frustration. I hope someone will be able to update those docs soon!