def test_msg_params():
    owl = TemplOwl('*****@*****.**', 100500, subject='Some email subject', ctx={'a': 'b'})

    assert owl.msg.from_email == 'Jesus Christ <*****@*****.**>'
    assert owl.msg.merge_global_data == {'a': 'b'}
    assert owl.msg.template_id == 100500
    assert owl.msg.subject == 'Some email subject'
def send_mail(to: Union[List, str], template_id, subject: str = '', ctx: dict = None, disable_antispam=False):
    TemplOwl(
        to=to,
        template_id=template_id,
        subject=subject,
        ctx=ctx,
        disable_antispam=disable_antispam,
    ).send()
Exemple #3
0
def send_mail(to: Union[List, str],
              template_id,
              subject: str = '',
              ctx: dict = None):
    TemplOwl(
        to=to,
        template_id=template_id,
        subject=subject,
        ctx=ctx,
    ).send()
def owl():
    return TemplOwl(
        to='*****@*****.**',
        template_id=100500,
    )
def test_omitted_subject():
    owl = TemplOwl('*****@*****.**', 100500)

    assert owl.subject == ''
def test_subject():
    owl = TemplOwl('*****@*****.**', 100500, subject='Some email subject')

    assert owl.subject == 'Some email subject'
def test_dict(ctx, expected):
    owl = TemplOwl('*****@*****.**', 100500, ctx=ctx)
    assert owl.ctx == expected
def test_to(to, expected):
    owl = TemplOwl(to, 100500)

    assert owl.to == expected