Пример #1
0
def send_welcome_email(group, user):
    """
    Sends a welcome email when a user sets up an account.
    """
    recipient_email = user.email
    recipient_name = user.first_name
    recipient = [recipient_email]
    bcc = ['*****@*****.**']
    group = group.name

    EMAIL_PATH = set_path(
        'registration/templates/',
        '/home/econvenor/webapps/econvenor/econvenor/registration/templates/')

    text_template_file = EMAIL_PATH + 'welcome_email.txt'
    html_template_file = EMAIL_PATH + 'welcome_email.html'
    sender = 'eConvenor <*****@*****.**>'
    subject = 'Welcome to eConvenor!'
    text_content = create_email_contents(text_template_file, recipient_name,
                                         group, recipient_email)
    html_content = create_email_contents(html_template_file, recipient_name,
                                         group, recipient_email)
    msg = EmailMultiAlternatives(subject, text_content, sender, recipient, bcc)
    msg.attach_alternative(html_content, "text/html")
    msg.send()
def send_belated_welcome_email(group, user):
    """
    Sends a welcome email when a user sets up an account.
    """
    recipient_email = user.email
    recipient_name = user.first_name
    recipient = [recipient_email]
    bcc = ['*****@*****.**']
    group = group.name
    signup_date = user.date_joined.strftime("%B %d")
    if signup_date[-2] == '0':
        signup_date = replace(signup_date, '0', '')

    EMAIL_PATH = set_path('utilities/management/commands/templates/',
        '/home/econvenor/webapps/econvenor/econvenor/utilities/management/'
        'commands/templates/')

    text_template_file = EMAIL_PATH + 'welcome_email_belated.txt'
    html_template_file = EMAIL_PATH + 'welcome_email_belated.html'
    sender = 'eConvenor <*****@*****.**>'
    subject = 'A belated welcome to eConvenor!'
    text_content = create_email_contents(text_template_file, recipient_name,
                                         signup_date, group, recipient_email)
    html_content = create_email_contents(html_template_file, recipient_name,
                                         signup_date, group, recipient_email)
    msg = EmailMultiAlternatives(subject, text_content, sender, recipient, bcc)
    msg.attach_alternative(html_content, "text/html")
    msg.send()
Пример #3
0
def send_belated_welcome_email(group, user):
    """
    Sends a welcome email when a user sets up an account.
    """  	
    recipient_email = user.email
    recipient_name = user.first_name
    recipient = [recipient_email]
    bcc = ['*****@*****.**']
    group = group.name
    signup_date = user.date_joined.strftime("%B %d")
    if signup_date[-2] == '0':
        signup_date = replace(signup_date, '0', '')

    EMAIL_PATH = set_path('utilities/management/commands/templates/',
        '/home/econvenor/webapps/econvenor/econvenor/utilities/management/'
        'commands/templates/')

    text_template_file = EMAIL_PATH + 'welcome_email_belated.txt'
    html_template_file = EMAIL_PATH + 'welcome_email_belated.html'	
    sender = 'eConvenor <*****@*****.**>'
    subject = 'A belated welcome to eConvenor!'
    text_content = create_email_contents(text_template_file, recipient_name,
                                         signup_date, group, recipient_email)
    html_content = create_email_contents(html_template_file, recipient_name,
                                         signup_date, group, recipient_email)
    msg = EmailMultiAlternatives(subject, text_content, sender, recipient, bcc)
    msg.attach_alternative(html_content, "text/html")
    msg.send()
Пример #4
0
def ask_question(request):
    MARKDOWN_PATH = set_path('help/markdown/',
        '/home/econvenor/webapps/econvenor/econvenor/help/markdown/')
    page_content = convert_markdown_to_html(MARKDOWN_PATH + 'ask_question.mkd')

    menu = {'parent': 'help'}            	
    return render(request, 'markdown_template.html', {
                  'menu': menu,
                  'page_content': page_content
                  })
Пример #5
0
def ask_question(request):
    MARKDOWN_PATH = set_path(
        'help/markdown/',
        '/home/econvenor/webapps/econvenor/econvenor/help/markdown/')
    page_content = convert_markdown_to_html(MARKDOWN_PATH + 'ask_question.mkd')

    menu = {'parent': 'help'}
    return render(request, 'markdown_template.html', {
        'menu': menu,
        'page_content': page_content
    })
Пример #6
0
def send_welcome_email(group, user):
    """
    Sends a welcome email when a user sets up an account.
    """
    recipient_email = user.email
    recipient_name = user.first_name
    recipient = [recipient_email]
    bcc = ["*****@*****.**"]
    group = group.name

    EMAIL_PATH = set_path(
        "registration/templates/", "/home/econvenor/webapps/econvenor/econvenor/registration/templates/"
    )

    text_template_file = EMAIL_PATH + "welcome_email.txt"
    html_template_file = EMAIL_PATH + "welcome_email.html"
    sender = "eConvenor <*****@*****.**>"
    subject = "Welcome to eConvenor!"
    text_content = create_email_contents(text_template_file, recipient_name, group, recipient_email)
    html_content = create_email_contents(html_template_file, recipient_name, group, recipient_email)
    msg = EmailMultiAlternatives(subject, text_content, sender, recipient, bcc)
    msg.attach_alternative(html_content, "text/html")
    msg.send()