Exemplo n.º 1
0
def sendMail(subscription, groups):
  if hasattr(subscription, 'email'):
    email = subscription.email
  else:
    email = subscription['email']

  name, address = parseaddr(email)
  email = formatmime(name) + ' <' + formatmime(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})
Exemplo n.º 2
0
def sendMail(subscription, groups):
    if hasattr(subscription, 'email'):
        email = subscription.email
    else:
        email = subscription['email']

    name, address = parseaddr(email)
    email = formatmime(formataddr((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})