LPgenerator / django-db-mailer

Django module to easily send emails/sms/tts/push using django templates stored on database and managed through the Django Admin
https://github.com/LPgenerator/django-db-mailer
GNU General Public License v2.0
255 stars 81 forks source link

Bug when trying to send Context to the Template #72

Closed tyapkov closed 8 years ago

tyapkov commented 8 years ago

I tried in different ways to pass the context to the template but it is not working for me. When I am trying to do it in such way:

    send_db_mail(slug="account_confirmation_email",
                 recipient = self.user.email,
                 {'username': 'Alexander'},
                 use_celery = True)

I get (Python 3):

SyntaxError: positional argument follows keyword argument

If I am doing it like:

    send_db_mail({'username':'Alexander'},
                 slug="account_confirmation_email",
                 recipient = self.user.email,
                 use_celery = True)

I get:

Exception Type: TypeError Exception Value: db_sender() got multiple values for argument 'slug'

For me it looks like a bug or if no, then please send me a simple example how to push context to the template. Thank you!

gotlium commented 8 years ago

Duplicate #5 and #10

send_db_mail("account_confirmation_email", self.user.email, 
            {'username':'Alexander'},
             use_celery = True
)
tyapkov commented 8 years ago

Cпасибо! Работает.