-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The emails kept getting discarded by App Engine, and after trying different things it turns out that they just really don't like our links to the page. So, removed those, and added some url parameters to the /sendmail page to allow you to send a mail multiple times, and send an email for an arbitrary date, with ?force=1&date=20xx-xx-xx
- Loading branch information
Einar Egilsson
committed
Feb 12, 2016
1 parent
afa6f16
commit dd0e2ea
Showing
3 changed files
with
31 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1.2.2 | ||
1.2.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,17 @@ | ||
import webapp2 | ||
import webapp2, datetime | ||
from models.dailymail import DailyMail | ||
|
||
class SendMailHandler(webapp2.RequestHandler): | ||
def get(self): | ||
|
||
DailyMail().send() | ||
force = self.request.get('force', '0') == '1' | ||
date = self.request.get('date', None) | ||
if date: | ||
try: | ||
y,m,d = date.split('-') | ||
date = datetime.datetime(int(y), int(m), int(d)).date() | ||
except: | ||
self.response.out.write('Invalid date, ignored') | ||
|
||
DailyMail().send(False, force, date) | ||
self.response.out.write('Ran daily mail at ' + str(datetime.datetime.now())) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters