Browse files

better config docs

  • Loading branch information...
mcdonc committed Mar 9, 2011
1 parent 688c450 commit d81998c6672796d6174df808cfb1b0b03b59b0ae
Showing with 30 additions and 7 deletions.
  1. +30 −7 docs/index.rst
@@ -135,16 +135,38 @@ construct and set your own mailer in this way.
-If you create your ``Mailer`` instance using
+If you configure a ``Mailer`` using
:meth:`pyramid_mailer.mailer.Mailer.from_settings` or
``config.include('pyramid_mailer')``, you can pass the settings from your
-.ini file or other source. By default, the prefix is assumed to be `mail.`.
-If you use the ``config.include`` mechanism, to set another prefix, use the
-``pyramid_mailer.prefix`` key in the config file,
-e.g. ``pyramid_mailer.prefix = foo.``. If you use the
-:meth:`pyramid_mailer.Mailer.Mailer.from_settings` or
+Paste ``.ini`` file. For example::
+ [app:myproject]
+ = localhost
+ mail.port = 25
+By default, the prefix for is assumed to be `mail.`. If you use the
+``config.include`` mechanism, to set another prefix, use the
+``pyramid_mailer.prefix`` key in the config file. For example::
+ [app:myproject]
+ = localhost
+ foo.port = 25
+ pyramid_mailer.prefix = foo.
+If you use the :meth:`pyramid_mailer.Mailer.Mailer.from_settings` or
:func:`pyramid_mailer.mailer_factory_from_settings` API, these accept a
-prefix directly.
+prefix directly; for example::
+ mailer_factory_from_settings(settings, prefix='foo.')
+If you don't use Paste, just pass the settings directly into your Pyramid
+ settings = {'':'localhost', 'mail.port':'25'}
+ Configurator(settings=settings)
+ config.include('pyramid_mailer')
+The available settings are listed below.
========================= =============== =====================
Setting Default Description
@@ -221,6 +243,7 @@ class::
You can pass the data either as a string or file object, so the above code
could be rewritten::
from pyramid_mailer.message import Attachment
from pyramid_mailer.message import Message

0 comments on commit d81998c

Please sign in to comment.