Ejemplo n.º 1
0
def member_joined_activityarea(area, member):
    EmailSender.get_sender(
        organisation_subject(
            _('Neues Mitglied im Taetigkeitsbereich {0}').format(area.name)),
        _('Soeben hat sich {0} {1} in den Taetigkeitsbereich {2} eingetragen').
        format(member.first_name, member.last_name, area.name),
    ).send_to(area.get_email())
Ejemplo n.º 2
0
def subscription_canceled(subscription, message):
    EmailSender.get_sender(
        organisation_subject(
            _('{} gekündigt').format(Config.vocabulary('subscription'))),
        get_email_content('s_canceled', base_dict(locals())),
        bcc=get_emails_by_permission(
            'notified_on_subscription_cancellation')).send()
Ejemplo n.º 3
0
def job_reminder(emails, job, participants):
    contact = job.type.activityarea.coordinator.get_name() + ': ' + job.type.activityarea.contact()
    EmailSender.get_sender(
        organisation_subject(_('Einsatz-Erinnerung')),
        get_email_content('j_reminder', base_dict(locals())),
        bcc=emails
    ).attach_ics(generate_ical_for_job(job)).continue_thread(job).send()
Ejemplo n.º 4
0
def member_canceled(member, end_date, message):
    EmailSender.get_sender(organisation_subject(
        _('{} gekündigt').format(Config.vocabulary('member_type'))),
                           get_email_content('m_canceled',
                                             base_dict(locals())),
                           bcc=get_emails_by_permission(
                               'notified_on_member_cancellation')).send()
Ejemplo n.º 5
0
def member_left_activityarea(area, member):
    EmailSender.get_sender(
        organisation_subject(
            _('Mitglied verlässt Taetigkeitsbereich {0}').format(area.name)),
        _('Soeben hat sich {0} {1} aus dem Taetigkeitsbereich {2} ausgetragen. '
          'Bitte lösche seine Kontaktdaten aus allen deinen Privaten Adressbüchern'
          ).format(member.first_name, member.last_name, area.name),
    ).send_to(area.get_email())
Ejemplo n.º 6
0
def welcome_co_member(co_member, password, new_shares, new=True):
    # sends either welcome mail or just information mail to new/added co-member
    sub = co_member.subscription_future or co_member.subscription_current
    EmailSender.get_sender(
        _('Willkommen bei {0}').format(enriched_organisation('D')),
        get_email_content('co_welcome' if new else 'co_added',
                          base_dict(locals())),
    ).send_to(co_member.email)
Ejemplo n.º 7
0
def internal(subject, message, text_message, emails, files, sender):
    htmld = base_dict({
        'mail_template': Config.mail_template,
        'subject': subject,
        'content': message
    })
    textd = base_dict({'subject': subject, 'content': text_message})
    text_content = get_template('mails/form/filtered_mail.txt').render(textd)
    html_content = get_template('mails/form/filtered_mail.html').render(htmld)
    EmailSender.get_sender(subject, text_content, bcc=emails, from_email=sender)\
        .attach_html(html_content).attach_files(files).send()
Ejemplo n.º 8
0
def send_bill_share(bill, share, member):
    plaintext = get_template('mails/bill_share.txt')
    d = {
        'member': member,
        'bill': bill,
        'share': share,
        'serverurl': get_server()
    }
    content = plaintext.render(d)
    EmailSender.get_sender(
        organisation_subject(_('Bill {0}').format(Config.vocabulary('share'))),
        content,
    ).send_to(member.email)
Ejemplo n.º 9
0
def send_bill_notification(bill):
    # prepare variables that are passed to
    # template using locals()
    settings = Settings.objects.first()
    payment_type = settings.default_paymenttype
    business_year = bill.business_year
    member = bill.member
    start_date = business_year.start_date
    end_date = business_year.end_date

    plaintext = get_template('mails/bill_notification.txt')
    content = plaintext.render(base_dict(locals()))
    subject = organisation_subject(
        _('{0} Bill').format(Config.vocabulary('subscription')))

    EmailSender.get_sender(subject, content).send_to(member.email)
Ejemplo n.º 10
0
def contact_member(subject, message, member, contact_member, copy_to_member,
                   files):
    subject = _('Nachricht per {0}:').format(
        Config.adminportal_name()) + subject
    email_sender = EmailSender.get_sender(subject,
                                          message,
                                          reply_to=[member.email
                                                    ]).attach_files(files)
    email_sender.send_to(contact_member.email)
    if copy_to_member:
        email_sender.send_to(member.email)
Ejemplo n.º 11
0
def contact(subject, message, member, copy_to_member):
    subject = _('Anfrage per {0}:').format(Config.adminportal_name()) + subject
    email_sender = EmailSender.get_sender(subject, message)
    email_sender.send_to(Config.info_email(), reply_to=[member.email])
    if copy_to_member:
        email_sender.send_to(member.email)
Ejemplo n.º 12
0
def job_canceled(emails, job):
    EmailSender.get_sender(
        organisation_subject(_('Einsatz abgesagt')),
        get_email_content('j_canceled', base_dict(locals())),
        bcc=emails
    ).continue_thread(job).send()
Ejemplo n.º 13
0
def job_time_changed(emails, job):
    EmailSender.get_sender(
        organisation_subject(_('Einsatz-Zeit geändert')),
        get_email_content('j_changed', base_dict(locals())),
        bcc=emails
    ).attach_ics(generate_ical_for_job(job)).continue_thread(job).send()
Ejemplo n.º 14
0
def member_created(member, **kwargs):
    EmailSender.get_sender(organisation_subject(
        _('Neue/r/s {}').format(Config.vocabulary('member_type'))),
                           get_email_content('a_member_created',
                                             base_dict(locals())),
                           bcc=kwargs['emails']).send()
Ejemplo n.º 15
0
def job_signup(email, job):
    EmailSender.get_sender(
        organisation_subject(_('Für Einsatz angemeldet')),
        get_email_content('j_signup', base_dict(locals()))
    ).attach_ics(generate_ical_for_job(job)).start_thread(job).send_to(email)
Ejemplo n.º 16
0
def co_member_left_subscription(primary_member, co_member, message):
    EmailSender.get_sender(
        organisation_subject(_('Austritt aus {}').format(Config.vocabulary('subscription'))),
        get_email_content('m_left_subscription', base_dict(locals())),
        to=[primary_member.email]
    ).send()
Ejemplo n.º 17
0
def share_created(share):
    EmailSender.get_sender(
        organisation_subject(
            _('Neue/r/s {} erstellt').format(Config.vocabulary('share'))),
        get_email_content('a_share_created', base_dict(locals())),
        bcc=get_emails_by_permission('notified_on_share_creation')).send()
Ejemplo n.º 18
0
def reset_password(email, password):
    EmailSender.get_sender(
        organisation_subject(_('Dein neues Passwort')),
        get_email_content('password', base_dict(locals())),
    ).send_to(email)
Ejemplo n.º 19
0
def email_confirmation(member):
    d = {'hash': member.get_hash()}
    EmailSender.get_sender(
        organisation_subject(_('E-Mail-Adresse bestätigen')),
        get_email_content('confirm', base_dict(d)),
    ).send_to(member.email)
Ejemplo n.º 20
0
def share_created(share, **kwargs):
    EmailSender.get_sender(organisation_subject(
        _('Neue/r/s {} erstellt').format(Config.vocabulary('share'))),
                           get_email_content('a_share_created',
                                             base_dict(locals())),
                           bcc=kwargs['emails']).send()
Ejemplo n.º 21
0
def member_canceled(member, end_date, message, **kwargs):
    EmailSender.get_sender(organisation_subject(
        _('{} gekündigt').format(Config.vocabulary('member_type'))),
                           get_email_content('m_canceled',
                                             base_dict(locals())),
                           bcc=kwargs['emails']).send()
Ejemplo n.º 22
0
def send_fund_confirmation_mail(fund, password=None):
    plaintext = get_template(CrowdfundingConfig.emails('fund_confirmation_mail'))
    content = plaintext.render(base_dict(locals()))
    EmailSender.get_sender(
        Config.organisation_name() + ' - Beitragsbestätigung',
        content).send_to(fund.funder.email)
Ejemplo n.º 23
0
def depot_changed(emails, depot):
    EmailSender.get_sender(
        organisation_subject(_('{} geändert').format(Config.vocabulary('depot'))),
        get_email_content('d_changed', base_dict(locals())),
        bcc=emails
    ).send()
Ejemplo n.º 24
0
def welcome(member, password):
    EmailSender.get_sender(
        _('Willkommen bei {0}').format(enriched_organisation('D')),
        get_email_content('welcome', base_dict(locals())),
    ).send_to(member.email)
Ejemplo n.º 25
0
def member_created(member):
    EmailSender.get_sender(
        organisation_subject(
            _('Neue/r/s {}').format(Config.vocabulary('member_type'))),
        get_email_content('a_member_created', base_dict(locals())),
        bcc=get_emails_by_permission('notified_on_member_creation')).send()
Ejemplo n.º 26
0
def shares_created(member, shares):
    EmailSender.get_sender(
        organisation_subject(_('Dein neuer Anteilschein')),
        get_email_content('s_created', base_dict(locals())),
    ).send_to(member.email)
Ejemplo n.º 27
0
def subscription_canceled(subscription, message, **kwargs):
    EmailSender.get_sender(organisation_subject(
        _('{} gekündigt').format(Config.vocabulary('subscription'))),
                           get_email_content('s_canceled',
                                             base_dict(locals())),
                           bcc=kwargs['emails']).send()