Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion emails/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
from hackathons.models import Hackathon, Sponsorship, Lead
from hackathons.views.sponsorships import combine_lead_and_contacts

from shared import packet

from .models import Email
from .forms import ComposeFromContactsForm, ComposeFromCompanyForm, ComposeFromIndustryForm, EmailChangeTypeForm

Expand Down Expand Up @@ -159,7 +161,7 @@ def send_message(request, h_pk, pk):
message = email.render_body(contact)
packet_file = None
if email.attach_packet:
packet_file = os.path.join(settings.PROJECT_ROOT, 'static', settings.SPONSORSHIP_PACKET_FILE)
packet_file = packet.get_packet_file_path()

print(f"SENDING: {email.subject} TO: {contact} ({contact.email}) ATTACHMENT: {packet_file}")
print(send_email_now(email.subject, message, contact.email, packet_file))
Expand Down
2 changes: 1 addition & 1 deletion website/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def str_environ(name, default=None):
# The local name of the sponsorship packet, to be stored in the website/static
# folder. If this file exists, it will be used. Otherwise, it will be
# redownloaded from SPONSORSHIP_PACKET_URL.
SPONSORSHIP_PACKET_FILE = str_environ("SPONSORSHIP_PACKET_FILE")
SPONSORSHIP_PACKET_FILE = str_environ("SPONSORSHIP_PACKET_FILE", "sponsorship.pdf")

if not PRODUCTION and 'DEBUG' not in os.environ:
DEBUG = True
Expand Down