Mail¶
Ferris provides a couple of lightweight wrapper functions around the App Engine Mail API for sending emails.
- ferris3.mail.send(recipient, subject, body, sender=None, reply_to=None, **kwargs)[source]¶
Sends an html email to recipient with the given subject and body.
If sender is none, it’s automatically set to settings['email_sender'], If the setting is not configured, then the default noreply@[appid].appspotmail.com is used.
Any additionally arguments are passed to mail.send_mail, such as headers.
- ferris3.mail.send_template(recipient, subject, template_name, context=None, theme=None, **kwargs)[source]¶
Renders a template using render() and sends an email in the same way as send().
For example:
mail.send_template( recipient='jondoe@example.com', subject='A Test Email', template_name='app/email/test.html', context={ 'name': 'George' } )
Would render the template app/email/test.html and email the rendered html.