From f5f525368c6054c31abf6c0ff786a31b2a388661 Mon Sep 17 00:00:00 2001 From: Akshen Date: Tue, 14 May 2019 15:34:16 +0530 Subject: 2nd Proposal Form Button --- fossee_manim/send_mails.py | 24 ++++++++++++++++++++++ .../templates/fossee_manim/edit_proposal.html | 3 ++- fossee_manim/views.py | 7 ++++++- 3 files changed, 32 insertions(+), 2 deletions(-) (limited to 'fossee_manim') diff --git a/fossee_manim/send_mails.py b/fossee_manim/send_mails.py index 93841f2..a35f6f4 100644 --- a/fossee_manim/send_mails.py +++ b/fossee_manim/send_mails.py @@ -131,3 +131,27 @@ def send_email(request, call_on, contributor=None, key=None, proposal=None): send_mail( "FOSSEE Animation Comment by Reviewer", message, SENDER_EMAIL, [contributor.profile.user.email], fail_silently=True) + elif call_on == 'proposal_form': + message = dedent("""\ + Hey {0}, + + Please find the attachment, fill the form and reply to this + mail. + + In case of queries, please revert to this + email.""".format(contributor.profile.user.username)) + + logging.info("Animation Proposal Form 2: %s", request.user.email) + subject = "FOSSEE Animation Proposal Form 2" + msg = EmailMultiAlternatives(subject, message, SENDER_EMAIL, + [contributor.profile.user.email]) + attachment_paths = path.join(settings.MEDIA_ROOT, "Proposal_Form") + files = listdir(attachment_paths) + for f in files: + attachment = open(path.join(attachment_paths, f), 'rb') + part = MIMEBase('application', 'octet-stream') + part.set_payload((attachment).read()) + encoders.encode_base64(part) + part.add_header('Content-Disposition', "attachment; filename= %s " % f) + msg.attach(part) + msg.send() diff --git a/fossee_manim/templates/fossee_manim/edit_proposal.html b/fossee_manim/templates/fossee_manim/edit_proposal.html index 55c0f75..08fe638 100644 --- a/fossee_manim/templates/fossee_manim/edit_proposal.html +++ b/fossee_manim/templates/fossee_manim/edit_proposal.html @@ -47,7 +47,8 @@