I was only able to "almost" make it work as I wanted using complete path for
the view, complete path including extension for the layout and passing the
PropertyBag as parameters param. In my case is like this:
RenderMailMessage("/mail/register", "/layouts/mail.vm", PropertyBag);
And I think something like this would be more appropriate:
RenderMailMessage("register", "mail");
I don't understand why is it so different from the RC3 and from the
controller/view mechanism. If I am in a controller and i call RenderView I
don't have to include the view folder because is assumed that is the
controler name, and nowhere else I include the view extension, and the
PropertyBag and Helpers where automaticaly available.
Why is this behaviour so different?
How can i make the Helpers available to the view engine?
Thanks.
2009/2/6 <[email protected]>
>
> My situation was identical to your situation, I went from RC3 to the
> trunk, and I ran into
> issues sending emails. I am using nvelocity view engine. As far as I
> know, you can definitely use, PropertyBag or Flash
> since I believe they are both IDictionaries.
>
> On Feb 5, 6:06 pm, Ricardo Lopes <[email protected]> wrote:
> > That's more or less what i was doing, so now you have to pass the
> variables
> > on the parameters param?
> >
> > From what you said I noticed the following changes from the RC3:
> >
> > - The mail folder was default for the view, now do I have to specify that
> > folder?
> >
> > - From your example i guess you are passing the variables as the
> parameters
> > params, in RC3 the PropertyBag, Flash, etc was available to the view
> engine,
> > did this changed?
> >
> > Thanks.
> >
> > 2009/2/5 <[email protected]>
> >
> >
> >
> > > If you want to use the overload method with this signature:
> > > RenderMailMessage(string templateName, string layoutName, IDictionary
> > > parameters),
> >
> > > you could do something like this as far as I know , ( note you will
> > > need to create your own template ):
> >
> > > Hashtable emailDictionary = new Hashtable();
> > > emailDictionary.Add("username", "david");
> > > emailDictionary.Add("to", "[email protected]");
> > > emailDictionary.Add("from", "[email protected]");
> > > emailDictionary.Add("subject", "Test Email");
> > > emailDictionary.Add("message", "This is a test email");
> > > Castle.Components.Common.EmailSender.Message message =
> > > RenderMailMessage("/mail/email.vm", null, emailDictionary);
> >
> > > DeliverEmail(message);
> >
> > > On Feb 5, 4:27 pm, rjlopes <[email protected]> wrote:
> > > > Hi,
> >
> > > > I recently switched to the trunk version and i noticed that the
> > > > RenderMailMessage changed and was marked as obsolete, so I tried to
> > > > change to some of the overaloaded versions but i didn't know what to
> > > > pass as the "parameters" param?
> >
> > > > I tried an empty IDictionary or null but got errors. I'm using
> > > > nvelocity view engine.
> >
> > > > Thanks.
> >
>
--
Ricardo Lopes
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Castle Project Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---