Custom logo in mail header

From two different v14.0.0 instances of Nextcloud, both have a custom theme set up theme "theme" => "themename" in config.php.

Problem: only one of them shows the custom logo in the header bar of any notification e-mail. It is loaded externally from https://domain/themes/themename/core/img/logo.png?v=somehash. The other one instead shows the default logo, which is loaded from https://otherdomain/core/img/logo.png?v=anotherhash.

In the browser, both of the sites show their correct custom logo both on the login page as well as in the top-left corner, when logged in. It is defined by

#header .logo {
    background-image: url('../img/logo.svg');
}

in /themes/themename/core/css/server.css.

The header of the e-mails of both instances does show the respective custom color, that is defined in

public function getMailHeaderColor() {
    return '#123456';
}

in /themes/themename/defaults.php, but there is no definition of a custom logo in that file. There should be no evidence for the PHP to know about a custom logo at all, so how does the custom logo get into the mail?

On the first instance I did experiment with the theming app when it first came out, but soon I dropped that and created a real custom theme instead. But this might be the cause of the custom logo in the mail, as it might still be cached somewhere and carried over various nc version upgrades.

So the question is: is that custom theming logo cached? If so, where? Actually I do not want to get rid of it, instead I want the other instance to also send mails using that custom logo in the header. In analogy to the color, is there a function that I can put into defaults.php ?

Any ideas?