module render.renderer

Inheritance diagram of pymmails.render.renderer

Short summary

module pymmails.render.renderer

Functions to dump emails

source on GitHub

Classes

class

truncated documentation

Renderer

defines way to render an email

Properties

property

truncated documentation

BufferWrite

returns self._buffer_write

Methods

method

truncated documentation

__init__

constructor, defines a template based on Jinja2

flush

flushes all files

render

render a mail

write

writes a mail, the function assumes the attachments were already dumped

Documentation

@file @brief Functions to dump emails

class pymmails.render.renderer.Renderer(tmpl, css, style_table='dataframe100l', style_highlight='dataframe100l_hl', buffer_write=None, fLOG=<function noLOG>)

Bases: object

defines way to render an email

constructor, defines a template based on Jinja2

@param tmpl template (string or file) @param css style @param style_table style for the table @param style_highlight style for highlighted cells @param buffer_write instance of class @see cl BufferFilesWriting

property BufferWrite

returns self._buffer_write

__init__(tmpl, css, style_table='dataframe100l', style_highlight='dataframe100l_hl', buffer_write=None, fLOG=<function noLOG>)

constructor, defines a template based on Jinja2

@param tmpl template (string or file) @param css style @param style_table style for the table @param style_highlight style for highlighted cells @param buffer_write instance of class @see cl BufferFilesWriting

flush()

flushes all files

@return number of bytes written

render(location, obj, attachments=None, file_css='mail_style.css')

render a mail

@paramp location location where this mail should be saved @param obj instance of an object @param file_css css file (where it is supposed to be stored) @param attachments attachments @return html, css (content)

The mail is stored in object message, css means the style sheet, render means this object, location means location, attachments is attachments:

{{ message.get_subject() }}

The value stored in file_css will be relative to location.

write(location, mail, filename, attachments=None, overwrite=False, file_css='mail_style.css', encoding='utf8')

writes a mail, the function assumes the attachments were already dumped

@param location location @param mail instance of an object or an iterator @param attachments list of attachments (see @see me dump_attachments) @param overwrite the function does not overwrite @param file_css css file (where it is supposed to be stored) @param encoding encoding @return list of written local files