HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //home/arjun/projects/buyercall/buyercall/lib/__pycache__/flask_mailplus.cpython-310.pyc
o

/�e�@s<ddlmZddlmZddlmZd
dd�Zddd	�ZdS)�)�render_template)�lazy_gettext)�mailNcOs||duri}|dur4d|vrttd���d|vrttd���t|fi|��|d<t|fddi|��|d<tj|i|��dS)a�
    Send a templated e-mail using a similar signature as Flask-Mail:
    http://pythonhosted.org/Flask-Mail/

    Except, it also supports template rendering. If you want to use a template
    then just omit the body and html kwargs to Flask-Mail and instead supply
    a path to a template. It will auto-lookup and render text/html messages.

    Example:
        ctx = {'user': current_user, 'reset_token': token}
        send_template_message('Password reset from Foo', ['you@example.com'],
                              template='user/mail/password_reset', ctx=ctx)

    :param subject:
    :param recipients:
    :param body:
    :param html:
    :param sender:
    :param cc:
    :param bcc:
    :param attachments:
    :param reply_to:
    :param date:
    :param charset:
    :param extra_headers:
    :param mail_options:
    :param rcpt_options:
    :param template: Path to a template without the extension
    :param ctx: Dictionary of anything you want in the template context
    :return: None
    N�bodyz-You cannot have both a template and body arg.�html�ext)�	Exception�_�_try_renderer_templater�send_message)�template�ctx�args�kwargs�r�>/home/arjun/projects/buyercall/buyercall/lib/flask_mailplus.py�send_template_messages r�txtcKs0z
td�||�fi|��WStyYdSw)a
    Attempt to render a template. We use a try/catch here to avoid having to
    do a path exists based on a relative path to the template.

    :param template_path: Template path
    :type template_path: str
    :param ext: File extension
    :type ext: str
    :return: str
    z{0}.{1}N)r�format�IOError)�
template_pathrrrrrr
6s
�r
)NN)r)	�flaskr�flask_babelrr	�buyercall.extensionsrrr
rrrr�<module>s

0