Finally we wrote a management command to handle the actual sending which called a function that looks something like this:
template_id = random.choice(SAVE_THE_DATE_CONTEXT_MAP.keys())
context = get_save_the_date_context(template_id)
context[’email_mode’] = False
return render(request, SAVE_THE_DATE_TEMPLATE, context=context)
Function to send the save the dates with some additional testing options.
After a lot of testing we were confident everything was good to go and it was time to push the big scary “send” button (or in this case run ./manage.py send_save_the_dates –send –mark-sent).
Almost immediately we started getting some fun responses from our friends talking about the save the dates and it was fun watching them get confused about describing different templates.
All in all, thanks to thorough testing and preparation it was a great success!
Though I should note that, probably not surprisingly, the whole thing took quite a bit longer than expected. And we were just getting started!
View original post 1,174 more words