Esempio n. 1
0
def make_bcga16_invitation_email(member, url):
    """
    Create email subject and body for an invitation email for members.

    Returns:
        Tuple: message subject and body in users language.
    """
    if DEBUG:  # pragma: no cover
        print(u"the member: {}".format(member))
        print(u"the member.locale: {}".format(member.locale))
        print(u"the url: {}".format(url))
        print(u"the subject: {}".format(
            get_template_text('bcga2016_invite_subject', member.locale)))
        print(u"the salutation: {}".format(get_salutation(member)))
        print(u"the footer: {}".format(get_email_footer(member.locale)))
        print(u"the body: {}".format(
            get_template_text('bcga2016_invite_body', member.locale).format(
                salutation=get_salutation(member),
                invitation_url=url,
                footer=get_email_footer(member.locale))))
    return (
        get_template_text('bcga2016_invite_subject', member.locale).rstrip(
            '\n'),  # remove newline (\n) from mail subject
        get_template_text('bcga2016_invite_body', member.locale).format(
            salutation=get_salutation(member),
            invitation_url=url,
            footer=get_email_footer(member.locale)
        )
    )
Esempio n. 2
0
def make_bcga18_invitation_email(member, url):
    """
    Create email subject and body for an invitation email for members.

    Returns:
        Tuple: message subject and body in users language.
    """
    if DEBUG:  # pragma: no cover
        print(u"the member: {}".format(member))
        print(u"the member.locale: {}".format(member.locale))
        print(u"the url: {}".format(url))
        print(u"the subject: {}".format(
            get_template_text('bcga2018_invite_subject', member.locale)))
        print(u"the salutation: {}".format(get_salutation(member)))
        print(u"the footer: {}".format(get_email_footer(member.locale)))
        print(u"the body: {}".format(
            get_template_text('bcga2018_invite_body', member.locale).format(
                salutation=get_salutation(member),
                invitation_url=url,
                footer=get_email_footer(member.locale))))
    return (
        get_template_text('bcga2018_invite_subject', member.locale).rstrip(
            '\n'),  # remove newline (\n) from mail subject
        get_template_text('bcga2018_invite_body', member.locale).format(
            salutation=get_salutation(member),
            invitation_url=url,
            footer=get_email_footer(member.locale)))
    def test_get_salutation(self):
        self.member.firstname = u'firßtname'
        self.member.lastname = u'lastnäme'
        self.member.is_legalentity = False
        self.assertEqual(get_salutation(self.member), u'firßtname lastnäme')

        self.member.firstname = u'firßtname'
        self.member.is_legalentity = True
        self.assertEqual(get_salutation(self.member), u'firßtname')
Esempio n. 4
0
def make_dues_exemption_email(member, reversal_url):
    """
    Create email subject and body for an invoice exemption.
    """
    return (get_template_text('dues_exemption_subject', member.locale),
            get_template_text('dues_exemption_body', member.locale).format(
                salutation=get_salutation(member),
                reversal_invoice_url=reversal_url,
                footer=get_email_footer(member.locale)))
Esempio n. 5
0
def make_dues_exemption_email(member, reversal_url):
    """
    Create email subject and body for an invoice exemption.
    """
    return (
        get_template_text('dues_exemption_subject', member.locale),
        get_template_text('dues_exemption_body', member.locale).format(
            salutation=get_salutation(member),
            reversal_invoice_url=reversal_url,
            footer=get_email_footer(member.locale)))
Esempio n. 6
0
def make_dues_invoice_investing_email(member):
    """
    Create email subject and body for an invoice notification for investing
    members.
    """
    return (get_template_text('dues_invoice_investing_subject', member.locale),
            get_template_text('dues_invoice_investing_body',
                              member.locale).format(
                                  salutation=get_salutation(member),
                                  membership_number=member.membership_number,
                                  footer=get_email_footer(member.locale)))
def make_signature_reminder_email(member):
    '''
    a mail body to remind membership applicants
    to send the form with their signature
    '''
    return (
        get_template_text('signature_reminder_subject', member.locale),
        get_template_text('signature_reminder_body', member.locale).format(
            salutation=get_salutation(member),
            submission_date=format_date(
                member.date_of_submission,
                member.locale),
            footer=get_email_footer(member.locale)))
Esempio n. 8
0
def make_dues_reduction_email(member, invoice, invoice_url, reversal_url):
    """
    Create email subject and body for an invoice reduction.
    """
    return (get_template_text('dues_reduction_subject', member.locale),
            get_template_text('dues_reduction_body', member.locale).format(
                salutation=get_salutation(member),
                dues_amount=str(member.dues15_amount_reduced),
                invoice_number=invoice.invoice_no_string,
                membership_number=member.membership_number,
                invoice_url=invoice_url,
                reversal_invoice_url=reversal_url,
                footer=get_email_footer(member.locale)))
Esempio n. 9
0
def make_dues_invoice_legalentity_email(member):
    """
    Create email subject and body for an invoice notification for legal entity
    members.
    """
    return (get_template_text('dues_invoice_legalentity_subject',
                              member.locale),
            get_template_text('dues_invoice_legalentity_body',
                              member.locale).format(
                                  salutation=get_salutation(member),
                                  legal_entity_name=member.lastname,
                                  membership_number=member.membership_number,
                                  footer=get_email_footer(member.locale)))
Esempio n. 10
0
def make_dues16_reduction_email(member, invoice, invoice_url, reversal_url):
    """
    Create email subject and body for an invoice reduction.
    """
    return (
        get_template_text('dues_reduction_subject', member.locale),
        get_template_text('dues_reduction_body', member.locale).format(
            salutation=get_salutation(member),
            dues_amount=str(member.dues16_amount_reduced),
            invoice_number=invoice.invoice_no_string,
            membership_number=member.membership_number,
            invoice_url=invoice_url,
            reversal_invoice_url=reversal_url,
            footer=get_email_footer(member.locale)))
Esempio n. 11
0
def make_dues_invoice_investing_email(member):
    """
    Create email subject and body for an invoice notification for investing
    members.
    """
    return (
        get_template_text('dues_invoice_investing_subject', member.locale),
        get_template_text(
            'dues_invoice_investing_body',
            member.locale
        ).format(
            salutation=get_salutation(member),
            membership_number=member.membership_number,
            footer=get_email_footer(member.locale)))
Esempio n. 12
0
def make_dues17_invoice_email(member, invoice, invoice_url, invoice_quarter):
    """
    Create email subject and body for an invoice notification for full
    members.
    """
    return (get_template_text('dues_invoice_subject', member.locale),
            get_template_text('dues_invoice_body', member.locale).format(
                salutation=get_salutation(member),
                dues_amount=str(member.dues17_amount),
                invoice_url=invoice_url,
                invoice_quarter=invoice_quarter,
                invoice_number=invoice.invoice_no_string,
                membership_number=member.membership_number,
                footer=get_email_footer(member.locale)))
Esempio n. 13
0
def make_dues_invoice_legalentity_email(member):
    """
    Create email subject and body for an invoice notification for legal entity
    members.
    """
    return (
        get_template_text('dues_invoice_legalentity_subject', member.locale),
        get_template_text(
            'dues_invoice_legalentity_body',
            member.locale
        ).format(
            salutation=get_salutation(member),
            legal_entity_name=member.lastname,
            membership_number=member.membership_number,
            footer=get_email_footer(member.locale)))
Esempio n. 14
0
def make_dues16_invoice_email(member, invoice, invoice_url, invoice_quarter):
    """
    Create email subject and body for an invoice notification for full
    members.
    """
    return (
        get_template_text('dues_invoice_subject', member.locale),
        get_template_text('dues_invoice_body', member.locale).format(
            salutation=get_salutation(member),
            dues_amount=str(member.dues16_amount),
            invoice_url=invoice_url,
            invoice_quarter=invoice_quarter,
            invoice_number=invoice.invoice_no_string,
            membership_number=member.membership_number,
            footer=get_email_footer(member.locale)))
def make_payment_reminder_email(member):
    '''
    a mail body to remind membership applicants
    to send the payment for their shares
    '''
    return (
        get_template_text('payment_reminder_subject', member.locale),
        get_template_text('payment_reminder_body', member.locale).format(
            salutation=get_salutation(member),
            submission_date=format_date(
                member.date_of_submission,
                member.locale),
            shares_value=int(member.num_shares) * 50,
            shares_count=member.num_shares,
            transfer_purpose=u'C3Shares ' + member.email_confirm_code,
            footer=get_email_footer(member.locale)))