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: support@mycompany.com.

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

Code-behind

Add the following using statement:

using Telerik.Sitefinity.Localization;

Reference the label using the following code:

Res.Get<ProductsResources>().AmazonSearchServiceTitle

www.progress.com/.../for-developers-create-custom-resource-classes

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

[mention:618aa021aa0d4f59b0baea5ca3e34d66:e9ed411860ed4f2ba0265705b8793d05]

thanks for your reply.

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

This thread is closed