I have a custom policy that allows me to create users in my Azure B2C directory. In this policy I have modified the display control to send emails following this article:
https://learn.microsoft.com/en-us/azure/active-directory-b2c/custom-email-sendgrid
From time to time, I get this JavaScript error when clicking on the Send code button:
ReferenceError: isMessageSafe is not defined
at Object.changeVerificationControlState
Looking at the JavaScript code in my browser (using the prettified version provided by Chrome), I see this code, but the isMessageSafe variable does not seem to be sent anywhere, which would explain the JavaScript error
changeVerificationControlState: function(n, t, u, f) {
// ...
switch (t) {
// ...
case r.FAILED_TO_SEND:
u && ($(e).attr("aria-label", u),
isMessageSafe ? $(e).html(u) : $(e).text(u));
i.showElementsAndEnableControls(s, [o, y, e], h, l);
break;
// ...
}
}
Here is the content definition for the api.localaccountsignup I use for account sign up
<ContentDefinition Id="api.localaccountsignup">
<LoadUri>~/tenant/templates/AzureBlue/selfAsserted.cshtml</LoadUri>
<RecoveryUri>~/common/default_page_error.html</RecoveryUri>
<DataUri>urn:com:microsoft:aad:b2c:elements:contract:selfasserted:2.1.2</DataUri>
<Metadata>
<Item Key="DisplayName">Local account sign up page</Item>
</Metadata>
</ContentDefinition>
Thank you!