On Tue, 2011-03-01 at 17:58 -0800, oO wrote:
> is there a framework adapter for pyramid in TurboMail yet? or can you
> just use the pylons one?
> 
> One of the nice things about pyramid_mailer is the fact that you stick
> your settings in the ini file, and you have a simple
> Mailer.from_settings(settings) call.

Not really related to which mailer is used, but if this little stanza
was added to pyramid_mailer's __init__.py (verbatim):

  def includeme(config):
      settings = config.settings
      prefix = settings.get('pyramid_mailer.prefix', 'mail.')
      settings['pyramid_mailer'] = Mailer.from_settings(settings,
                                                        prefix)

Then during configuration, rather than needing to do imports of
``pyramid_mailer`` and subseqently placing the mailer somewhere where
you can get to it later:

  mailer = pyramid_mailer.mailer_from_settings(config.settings)
  config.settings['pyramid_mailer'] = mailer

You'd be able to do this during normal configuration:

  config.include('pyramid_mailer')

And subsequently in your view code (in either case):

  request.settings['pyramid_mailer'].send(mymessage)

- C


> 
> oO
> 
> 
> On Mar 1, 4:36 pm, Alice Bevan–McGregor <[email protected]> wrote:
> > > pyramid_mailer is working great too…
> >
> > TurboMail has the advantage on being completely consistent across
> > platforms (e.g. a shell Python script, web framework, etc.) and it has
> > no external dependancies whatsoever.  (Testing uses pymta as a local
> > fake SMTP server.)  It also has a much more comprehensive Message class
> > and more flexible handling of addresses (strings, name/addr tuples,
> > lists of either) using some descriptor magic.
> >
> >         — Alice.
> 


-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" 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/pylons-discuss?hl=en.

Reply via email to