forked from beba/foerderbarometer
sendmails is sending html regarding the informing of the organisator when not happened
This commit is contained in:
parent
43df9bd353
commit
21cfd50972
|
@ -115,8 +115,9 @@ class Command(BaseCommand):
|
|||
|
||||
html_mail_template = get_template('input/if_not_of_project_approved.html')
|
||||
txt_mail_template = get_template('input/if_not_of_project_approved.txt')
|
||||
informMail_template = get_template('input/if_end_of_project_orginformed.txt')
|
||||
|
||||
|
||||
txt_informMail_template = get_template('input/if_end_of_project_orginformed.txt')
|
||||
html_informMail_template = get_template('input/if_end_of_project_orginformed.html')
|
||||
# send the mail to project.email, which would be the mail of the volunteer that filled out the form
|
||||
|
||||
for project in approved_notHappened:
|
||||
|
@ -137,11 +138,19 @@ class Command(BaseCommand):
|
|||
# IF_EMAIL,
|
||||
# [project.email],
|
||||
# fail_silently=False)
|
||||
send_mail('Projektorganisator*in wurde informiert',
|
||||
informMail_template.render(context),
|
||||
IF_EMAIL,
|
||||
[IF_EMAIL],
|
||||
fail_silently=False)
|
||||
|
||||
inform_subject, inform_from_email, inform_to = Projektorganisator*in wurde informiert', IF_EMAIL, IF_EMAIL
|
||||
inform_text_content = txt_informMail_template.render(context)
|
||||
inform_html_content = html_informMail_template.render(context)
|
||||
inform_msg = EmailMultiAlternatives(inform_subject, inform_text_content, inform_from_email, [inform_to])
|
||||
inform_msg.attach_alternative(html_content, "text/html")
|
||||
inform_msg.send()
|
||||
|
||||
#send_mail('Projektorganisator*in wurde informiert',
|
||||
# informMail_template.render(context),
|
||||
# IF_EMAIL,
|
||||
# [IF_EMAIL],
|
||||
# fail_silently=False)
|
||||
|
||||
project.end_mail_send = True
|
||||
project.save()
|
||||
|
|
Loading…
Reference in New Issue