Index: sitescripts/reports/bin/mailDigests.py |
=================================================================== |
--- a/sitescripts/reports/bin/mailDigests.py |
+++ b/sitescripts/reports/bin/mailDigests.py |
@@ -15,17 +15,17 @@ |
# You should have received a copy of the GNU General Public License |
# along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
import MySQLdb, os, sys, re, marshal |
from datetime import date |
from time import time |
from email.utils import parseaddr |
from sitescripts.utils import get_config, setupStderr |
-from sitescripts.templateFilters import formatmime |
+from sitescripts.templateFilters import formatmime, emailaddr |
from sitescripts.reports.utils import mailDigest, getReports, getReportSubscriptions, calculateReportSecret, getDigestId, getDigestSecret, getUserUsefulnessScore |
import sitescripts.subscriptions.subscriptionParser as subscriptionParser |
def loadSubscriptions(): |
global interval, weekDay |
subscriptions = subscriptionParser.readSubscriptions() |
@@ -122,18 +122,18 @@ def sendNotifications(reports): |
def sendMail(subscription, groups): |
if hasattr(subscription, 'email'): |
email = subscription.email |
else: |
email = subscription['email'] |
name, address = parseaddr(email) |
- email = formatmime(name) + ' <' + formatmime(address) + '>' |
- |
+ email = formatmime(emailaddr((name, address))) |
+ |
id = getDigestId(address) |
digestLink = get_config().get('reports', 'urlRoot') + 'digest?id=%s&secret=%s' % (id, getDigestSecret(id, date.today().isocalendar())) |
mailDigest({'email': email, 'digestLink': digestLink, 'subscription': subscription, 'groups': groups}) |
def calculateReportWeight(report, subscriptions): |
global currentTime, startTime |