How to create a variable/parameter that can be both retrieve

Posted by yong2khoo on 31-Jan-2020 02:11

Problem statement:

We setup a SMTP with our email, eg:

This email,

1) is hardcoded in C# when sending out registration email.

2) is hardcoded in cshtml for display purposes

3) is hardcoded in "Sitefinity -> Adminstrators -> ... -> Labels and Messages" (forgotPassword Email template)

Now, when there is a change in the email, developers have to search the entire project + sitefinity to replace this string.

Question: is there a way to set this value at sitefinity, such that it can be both retrieved from "labels and messages" (eg: ConfirmationUrl) and c# backend?

All Replies

Posted by jread on 31-Jan-2020 18:18

To retrieve labels/messages in C#:


Add the following using statement:

using Telerik.Sitefinity.Localization;

Reference the label using the following code:


Posted by yong2khoo on 03-Feb-2020 02:15


thanks for your reply.

but really, "Res.Get<ProductsResources>().AmazonSearchServiceTitle" doesn't appear to be 'intuitive' at first sight >.<

This thread is closed