예제 #1
0
def mail(env, project_root='.'):
    Participant._mailer = mandrill.Mandrill(env.mandrill_key)
    emails = {}
    emails_dir = project_root+'/emails/'
    i = len(emails_dir)
    for spt in find_files(emails_dir, '*.spt'):
        base_name = spt[i:-4]
        emails[base_name] = compile_email_spt(spt)
    Participant._emails = emails
예제 #2
0
def mail(env, project_root='.'):
    Participant._mailer = mandrill.Mandrill(env.mandrill_key)
    emails = {}
    emails_dir = project_root + '/emails/'
    i = len(emails_dir)
    for spt in find_files(emails_dir, '*.spt'):
        base_name = spt[i:-4]
        emails[base_name] = compile_email_spt(spt)
    Participant._emails = emails
예제 #3
0
def mail(env, project_root='.'):
    if env.aws_ses_access_key_id and env.aws_ses_secret_access_key and env.aws_ses_default_region:
        aspen.log_dammit("AWS SES is configured! We'll send mail through SES.")
        Participant._mailer = boto3.client(
            service_name='ses',
            region_name=env.aws_ses_default_region,
            aws_access_key_id=env.aws_ses_access_key_id,
            aws_secret_access_key=env.aws_ses_secret_access_key)
    else:
        aspen.log_dammit(
            "AWS SES is not configured! Mail will be dumped to the console here."
        )
        Participant._mailer = ConsoleMailer()
    emails = {}
    emails_dir = project_root + '/emails/'
    i = len(emails_dir)
    for spt in find_files(emails_dir, '*.spt'):
        base_name = spt[i:-4]
        emails[base_name] = compile_email_spt(spt)
    Participant._emails = emails