コード例 #1
0
 def test_sending_email(self):
     assert_true(
         send_email("*****@*****.**",
                    "*****@*****.**",
                    subject='no subject',
                    message="<h1>Greetings!</h1>",
                    ttls=False,
                    login=False))
コード例 #2
0
 def test_sending_email(self):
     assert_true(
         send_email('*****@*****.**',
                    '*****@*****.**',
                    subject='no subject',
                    message='<h1>Greetings!</h1>',
                    ttls=False,
                    login=False))
コード例 #3
0
def send_email_to_erpc_participants(participants, dry=True):
    from_addr = settings.FROM_EMAIL
    subject = 'Publishing results of ANES analyses for Election Research Pre-acceptance Competition'

    logger.info('About to send an email to {} ERPC participants'.format(
        len(participants)))

    for participant in participants:
        if not dry:
            logger.info('Sending to {}'.format(participant))
            send_email(from_addr=from_addr,
                       to_addr=participant,
                       subject=subject,
                       mimetype='text',
                       message=EMAIL_TEXT,
                       username=settings.MAIL_USERNAME,
                       password=settings.MAIL_PASSWORD)
        else:
            logger.info('Would have sent an email to {}'.format(participant))
コード例 #4
0
ファイル: impute_names.py プロジェクト: dplorimer/osf
def email_name(user):

    logging.debug('Emailing user {0}'.format(user.fullname))

    names = {'fullname': user.fullname}
    names.update(impute_names(user.fullname))

    message=email_template.format(**names).encode('utf-8')

    success = send_email(
        from_addr='*****@*****.**',
        to_addr=user.username,
        subject='Open Science Framework: Verify your citation information',
        message=message,
        mimetype='plain',
    )

    if success:
        logging.debug('Emailing user {0}: Success'.format(user.fullname))
    else:
        logging.debug('Emailing user {0}: Failure'.format(user.fullname))
コード例 #5
0
ファイル: test_email.py プロジェクト: erinspace/osf.io
 def test_sending_email(self):
     assert_true(send_email('*****@*****.**', '*****@*****.**', subject='no subject',
                              message='<h1>Greetings!</h1>', ttls=False, login=False))
コード例 #6
0
ファイル: test_email.py プロジェクト: AllisonLBowers/osf.io
 def test_sending_email(self):
     assert_true(send_email("*****@*****.**", "*****@*****.**", subject='no subject',
                              message="<h1>Greetings!</h1>", ttls=False, login=False))