Back to Top

here's what's happening

DNN Details 003: Editing DNN Emails, Privacy/Terms, and UI Labels

9/23/2020 DNN Details
DNN Details 003: Editing DNN Emails, Privacy/Terms, and UI Labels

Resources, GlobalResources, SharedResources and more in the Language Editor

You may not use or have any interest in DNN sites using multiple languages, but the Languages editor is still very useful for a variety of site customizations.

Most people approach their needs with a specific question and having all this power under Site Settings / Languages can make it difficult to figure out where to go when the question in your head is:

  • How do I edit the registration emails DNN sends?

  • Can I change the word "Site" to "Intranet" in a bunch of places in the PersonaBar?

  • Is it possible to customize my site's Terms and Conditions?

So let's do the thing in steps,here is how to change one of the DNN 9+ core emails sent out to the site (portal) administrator when a user gets locked out for too many bad login attempts.

  1. Log in to your DNN instance as a super user
  2. In PersonaBar: Settings, Site Settings >Languages tab
  3. Click the last icon in the row of your language, to open Language Editor (screenclip)
    screen clip
  4. On the top right, you can switch from Global down to Site/Portal **
  5. From the Resource File dropdown list, expand Global Resources
  6. Then select GlobalResources!this will initially display 100s of values
  7. In the Search box (1) on the right, type "LOCKOUT"
    DNN Language Editor changes
  8. You should now see both the BODY (2) and SUBJECT of the email.
  9. Make your changes in the Localized Value (3) box (or click the Edit Pencil at right for a nice popup mini-WYSIWYG editor)
  10. When done, click the Save Translation button (4).

** in D (above), which you choose is beyond the scope (not a pun) of this article.But in general you just need to understand if you want the change you are making to be global to the DNN instance - meaning any/all portals - or just for one site (portal).For us and a lot of projects, the DNN instance just has 1 single portal and in that case it is convenient to just use Global.

Don't Panic...

That's it, but it's worth noting that after saving these resource files (*.resx) DNN (ASP.NET really) needs to do some recompiling and it may take your site 3 to 20 seconds or more to display the next page refresh or request.

The above PersonaBar UI works, and after a few repetitions, works well enough for an occasional one-off edit.But if your skill set makes you feel comfortable editing files in DNN "under-the-hood," read on for a more efficient approach.

Another Way?

I work at an agency and we host over 200 sites.In the last 2 years, we've migrated a lot of our DNN project work to GitHub Repositories (private) and use VS Code to do quite a bit of our DNN design and customization work.We call this Open Heart Surgery (OHS) and should probably give acall-out to 2sxc's Daniel Mettler for the terminology.:)

I'll have to leave getting VS Code setup to do OHS with a DNN site for another article.But the GIF below shows a fast and efficient way to edit, find, and update a value in resources.Click to zoom the GIF to full size in a new window/tab...

VSCode DNN Open Heart Surgery Demo

  • In local files, edit (SFTP) config for the remote explorer to show the /App_GlobalResources folder (normally hidden in our projects)
  • Switch to remote files, find the resx, Edit in Local
  • Once open for editing, search for "smtp"
  • Make your change, save/upload

In the above GIF, one of our standard project edits is the SMTP Configuration Test email.It's nice when it shows up, but if you didn't initiate the test-send, how do you know which site it came from?Who sent it?In my world, it can waste a lot of time when one of those emails shows up and you don't know who sent it on your team (or maybe the client?).So in App_GlobalResources/GlobalResources.resx (or *.Portal-[#].resx) we simply add the token for the Portal Name, very helpful:

some code, SMTP TEST subject

And now you get an informative email:

Outlook email clip showing revised Dnn Email Subject for SMTP Configuration Test

You can see (and search) the full default version of DNN'sGlobalResources.resx file in the GitHub repository, which is also a fast way to search for stuff and quickly find the details and keys you are looking for.

HTML encoded text

One more tip?Above in the GIF, did you catch a glimpse of the encoded HTML in the key/value below the one we were editing?When working in a text editor (like vscode) for email body values that are in HTML, don't forget to encode (e.g."

" needs to be stored as "

").You can markup your HTML in any editor (VS Code is used in the example) and then easily convert itusing an online tool.There are many, just search for "html encode online" or rephrase as you like until you find one that works well for you.


Thanks: Will Strohl, Daniel Mettler, and Brittani Musgrove

Read more DNN Details posts...More about Accuraty...

And finally, a bonus shout out and thank you to the (unknown to me, but highly acclaimed) DNN developer who recently added the Host Email field - the email address the SMTP Configuration Test email (above) - to the PB/Settings, Server Settings tab, and SMTP Server sub-tab settings page!!cool

But what about DNN 8 and earlier?

If you are using DNN 8.x or earlier, two things.1) upgrade, upgrade now, please upgrade, just do it.2) this article recaps the past fairly well,Localizing the User Interface Content.

‹ Back to List

I look forward to working again soon with the Accuraty team andhighly recommendthem to whomever is looking for web design and web development.

Baidu
map