Item2260: MailerContrib cannot find email templates based on skin or web

Priority: Normal
Current State: Closed
Released In: 1.0.8
Target Release: patch
Applies To: Extension
Component: MailerContrib
Branches:
Reported By: KennethLavrsen
Waiting For: Main.KennethLavrsen
Last Change By: KennethLavrsen
MailerContrib cannot find email templates based on skin or web

MailerContrib that takes care of the WebNotify feature is supposed to select the mailnotify.tmpl using standard template path.

This way you can use a tailored email without hacking the distributed file simply by adding a mailnotify.skinname.tmpl

This works if you set a SKIN = notifyskin,pattern in SitePreferences.

But the minute you want the setting to be per web it will not work because the template is read without telling which web we are currently sending email from.

We are supposed to be able to set the SKIN macro in WebPreferences or even in WebNotify topic. But it does not work.

The fix to make it work is to make sure the code changes the current topic context to the WebNotify topic that it is currently processing.

This way you can tailor the email either by

  • Setting a SKIN variable in WebNotify or the WebPreferences (both will work) and defining a templates/mailnotify.skinname.tmpl
  • Creating a template in a subdirectory of the templates directory with same path as the web. Example templates/Webname/Subwebname/mailnotify.tmpl

I will check-in the simple fix that makes this work as it is weakly documented today.

And I will turn the weak documentation into something that you can actually understand.

I will make a release of MailerContrib so 1.0.7 users can upgrade the Contrib and start taking advantage of this now.

-- KennethLavrsen - 15 Oct 2009

As I updated the trunk I found huge differences. I skipped this one when I synced all the default extensions.

This time I took the task and checked the changes and they were just perltidy except for a simple fix from early summer that was not merged over.

The trunk and Release branch are now in sync except unit tests that do not work if merged over because of core code changes.

I am releasing now.

-- KennethLavrsen - 15 Oct 2009

ItemTemplate edit

Summary MailerContrib cannot find email templates based on skin or web
ReportedBy KennethLavrsen
Codebase 1.0.7
SVN Range Foswiki-1.0.7, Sun, 20 Sep 2009, build 5061
AppliesTo Extension
Component MailerContrib
Priority Normal
CurrentState Closed
WaitingFor KennethLavrsen
Checkins distro:16bd33659e02 distro:348ccdbe5528 distro:98c07390a6e3 distro:661e481de86f
TargetRelease patch
ReleasedIn 1.0.8
Topic revision: r7 - 29 Nov 2009, KennethLavrsen
 
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. see CopyrightStatement. Creative Commons License