This article describes how to make Logon form web part to resolve context macros in Subject of e-mails which are sent because of forgotten password.
Please find the file:

~\CMSWebParts\Membership\LogonForm.ascx.cs

There is following line of code (line about 328):

message.Subject = ResHelper.GetString("LogonForm.ForgottenPasswordSubject");


Please replace it with following code:

string emailSubject = null;
emailSubject = EmailHelper.GetSubject(emailTemplate, ResHelper.GetString("LogonForm.ForgottenPasswordSubject"));


Then there should be following code:

// Create macro resolver
MacroResolver resolver = new MacroResolver();
resolver.SourceParameters = macros;


Please, replace it with following code:

// Set resolver
ContextResolver resolver = CMSContext.CurrentResolver;
resolver.SourceParameters = macros;
resolver.EncodeResolvedValues = true;


message.Subject = resolver.ResolveMacros(emailSubject);

After this modification, your email subject should be resolved correctly.



See also:


Applies to: Kentico CMS 4.0
Created on 6/25/2009 5:10:39 AM in Web parts & Controls
 


Sitemap | Copyright 2008 Kentico software | Powered by Kentico