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())
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()
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()
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()
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())
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)
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()
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)
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)
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)
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)
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()
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()
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()
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)
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()
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()
def reset_password(email, password): EmailSender.get_sender( organisation_subject(_('Dein neues Passwort')), get_email_content('password', base_dict(locals())), ).send_to(email)
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)
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()
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()
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)
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()
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)
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()
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)
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()