Back to Top

Get In Touch

Our offices are located in downtown Champaign in the old Surface 51 building south of Champaign Surplus and just north of the intersection of Springfield and Neil:

309 S Neil St., Champaign, IL 61820-3169

Directions

Phone: (217) 531-2966  •   Fax: (866) 298-5499
General Inquiry: info@accuraty.com
Support request: support@accuraty.com

More info »

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

Resources, GlobalResources, SharedResources and more in the Language Editor

Wednesday, September 23, 2020

Author: Jeremy Farrance

You may not use or have any interest in DNN sites using multiple languages, but the Language 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)
    language editor icon
     
  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"
    language editor steps
     
  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 a call-out to 2sxc's Daniel Mettler for the terminology. :)

VSCode dnn edit walkthrough

  • 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:

Portal name data token

And now you get an informative email:

admin email address configuration test

You can see (and search) the full default version of DNN's GlobalResources.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.

vscode html text editor

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. "<p>" needs to be stored as "&lt;p&gt;"). You can markup your HTML in any editor (VS Code is used in the example) and then easily convert it using 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.

Posted In: Technical  |  Comments (0)

Wanna hear more?

Find out more about our services, or get started on your next project.

Let's go!

quick links