mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
notify: Reword notification emails
* Use numbered references for links. * Reword some messages. * Fix a typo. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
This commit is contained in:
parent
9746a65473
commit
a46f34a6c0
1 changed files with 52 additions and 26 deletions
|
@ -88,9 +88,9 @@ def send_resetkey(cur, uid):
|
||||||
|
|
||||||
subject = 'AUR Password Reset'
|
subject = 'AUR Password Reset'
|
||||||
body = 'A password reset request was submitted for the account %s ' \
|
body = 'A password reset request was submitted for the account %s ' \
|
||||||
'associated with your e-mail address. If you wish to reset your ' \
|
'associated with your email address. If you wish to reset your ' \
|
||||||
'password follow the link below, otherwise ignore this message ' \
|
'password follow the link [1] below, otherwise ignore this ' \
|
||||||
'and nothing will happen.' % (username)
|
'message and nothing will happen.' % (username)
|
||||||
body += '\n\n'
|
body += '\n\n'
|
||||||
body += '[1] ' + aur_location + '/passreset/?resetkey=' + resetkey
|
body += '[1] ' + aur_location + '/passreset/?resetkey=' + resetkey
|
||||||
|
|
||||||
|
@ -102,9 +102,10 @@ def welcome(cur, uid):
|
||||||
username, to, resetkey = cur.fetchone()
|
username, to, resetkey = cur.fetchone()
|
||||||
|
|
||||||
subject = 'Welcome to the Arch User Repository'
|
subject = 'Welcome to the Arch User Repository'
|
||||||
body = 'Welcome to %s! In order to set an initial password for your new ' \
|
body = 'Welcome to the Arch User Repository! In order to set an initial ' \
|
||||||
'account, please click the link below. If the link does not work ' \
|
'password for your new account, please click the link [1] below. ' \
|
||||||
'try copying and pasting it into your browser.' % (aur_location)
|
'If the link does not work, try copying and pasting it into your ' \
|
||||||
|
'browser.'
|
||||||
body += '\n\n'
|
body += '\n\n'
|
||||||
body += '[1] ' + aur_location + '/passreset/?resetkey=' + resetkey
|
body += '[1] ' + aur_location + '/passreset/?resetkey=' + resetkey
|
||||||
|
|
||||||
|
@ -118,11 +119,18 @@ def comment(cur, uid, pkgbase_id):
|
||||||
|
|
||||||
uri = aur_location + '/pkgbase/' + pkgbase + '/'
|
uri = aur_location + '/pkgbase/' + pkgbase + '/'
|
||||||
|
|
||||||
|
user_uri = aur_location + '/account/' + user + '/'
|
||||||
|
pkgbase_uri = aur_location + '/pkgbase/' + pkgbase + '/'
|
||||||
|
|
||||||
subject = 'AUR Comment for %s' % (pkgbase)
|
subject = 'AUR Comment for %s' % (pkgbase)
|
||||||
body = 'from %s\n%s wrote:\n\n%s\n\n--- \n' \
|
body = '%s [1] added the following comment to %s [2]:' % (user, pkgbase)
|
||||||
'If you no longer wish to receive notifications about this ' \
|
body += '\n\n' + text + '\n\n'
|
||||||
'package, please go the the above package page and click the ' \
|
body += 'If you no longer wish to receive notifications about this ' \
|
||||||
'UnNotify button.' % (uri, user, text)
|
'package, please go to the package page [2] and select "%s".' % \
|
||||||
|
('Disable notifications')
|
||||||
|
body += '\n\n'
|
||||||
|
body += '[1] ' + user_uri + '\n'
|
||||||
|
body += '[2] ' + pkgbase_uri
|
||||||
thread_id = '<pkg-notifications-' + pkgbase + '@aur.archlinux.org>'
|
thread_id = '<pkg-notifications-' + pkgbase + '@aur.archlinux.org>'
|
||||||
|
|
||||||
send_notification(to, subject, body, reference=thread_id)
|
send_notification(to, subject, body, reference=thread_id)
|
||||||
|
@ -136,9 +144,11 @@ def flag(cur, uid, pkgbase_id):
|
||||||
pkgbase_uri = aur_location + '/pkgbase/' + pkgbase + '/'
|
pkgbase_uri = aur_location + '/pkgbase/' + pkgbase + '/'
|
||||||
|
|
||||||
subject = 'AUR Out-of-date Notification for %s' % (pkgbase)
|
subject = 'AUR Out-of-date Notification for %s' % (pkgbase)
|
||||||
body = 'Your package %s has been flagged out of date by %s [1]. ' \
|
body = 'Your package %s [1] has been flagged out-of-date by %s [2]. ' % \
|
||||||
'You may view your package at:\n%s\n\n[1] %s' % \
|
(pkgbase, user)
|
||||||
(pkgbase, user, pkgbase_uri, user_uri)
|
body += '\n\n'
|
||||||
|
body += '[1] ' + pkgbase_uri + '\n'
|
||||||
|
body += '[2] ' + user_uri
|
||||||
|
|
||||||
send_notification(to, subject, body)
|
send_notification(to, subject, body)
|
||||||
|
|
||||||
|
@ -149,16 +159,28 @@ def delete(cur, uid, old_pkgbase_id, new_pkgbase_id=None):
|
||||||
new_pkgbase = pkgbase_from_id(cur, new_pkgbase_id)
|
new_pkgbase = pkgbase_from_id(cur, new_pkgbase_id)
|
||||||
to = get_recipients(cur, old_pkgbase_id, uid)
|
to = get_recipients(cur, old_pkgbase_id, uid)
|
||||||
|
|
||||||
|
user_uri = aur_location + '/account/' + user + '/'
|
||||||
|
pkgbase_uri = aur_location + '/pkgbase/' + pkgbase + '/'
|
||||||
|
|
||||||
subject = 'AUR Package deleted: %s' % (old_pkgbase)
|
subject = 'AUR Package deleted: %s' % (old_pkgbase)
|
||||||
if new_pkgbase_id:
|
if new_pkgbase_id:
|
||||||
new_pkgbase_uri = aur_location + '/pkgbase/' + new_pkgbase + '/'
|
new_pkgbase_uri = aur_location + '/pkgbase/' + new_pkgbase + '/'
|
||||||
body = '%s merged "%s" into "%s".\n\nYou will no longer receive ' \
|
body = '%s [1] merged %s [2] into %s [3].\n\n' \
|
||||||
'notifications about this package, please go to %s and click ' \
|
'You will no longer receive notifications about this ' \
|
||||||
'the Notify button if you wish to recieve them again.' % \
|
'package, please go to [3] and click "%s" if you wish to ' \
|
||||||
(user, old_pkgbase, new_pkgbase, new_pkgbase_uri)
|
'receive them again.' % \
|
||||||
|
(user, old_pkgbase, new_pkgbase, 'Notify of new comments')
|
||||||
|
body += '\n\n'
|
||||||
|
body += '[1] ' + user_uri + '\n'
|
||||||
|
body += '[2] ' + pkgbase_uri + '\n'
|
||||||
|
body += '[3] ' + new_pkgbase_uri
|
||||||
else:
|
else:
|
||||||
body = '%s deleted "%s".\n\nYou will no longer receive ' \
|
body = '%s [1] deleted %s [2].\n\n' \
|
||||||
'notifications about this package.' % (user, old_pkgbase)
|
'You will no longer receive notifications about this ' \
|
||||||
|
'package.' % (user, old_pkgbase)
|
||||||
|
body += '\n\n'
|
||||||
|
body += '[1] ' + user_uri + '\n'
|
||||||
|
body += '[2] ' + pkgbase_uri
|
||||||
|
|
||||||
send_notification(to, subject, body)
|
send_notification(to, subject, body)
|
||||||
|
|
||||||
|
@ -176,14 +198,18 @@ def request_open(cur, uid, reqid, reqtype, pkgbase_id, merge_into=None):
|
||||||
(int(reqid), reqtype.title(), pkgbase)
|
(int(reqid), reqtype.title(), pkgbase)
|
||||||
if merge_into:
|
if merge_into:
|
||||||
merge_into_uri = aur_location + '/pkgbase/' + merge_into + '/'
|
merge_into_uri = aur_location + '/pkgbase/' + merge_into + '/'
|
||||||
body = '%s [1] filed a request to merge %s [2] into %s [3]:\n\n' \
|
body = '%s [1] filed a request to merge %s [2] into %s [3]:' % \
|
||||||
'%s\n\n[1] %s\n[2] %s\n[3] %s\n' % \
|
(user, pkgbase, merge_into)
|
||||||
(user, pkgbase, merge_into, text, user_uri, pkgbase_uri,
|
body += '\n\n' + text + '\n\n'
|
||||||
merge_into_uri)
|
body += '[1] ' + user_uri + '\n'
|
||||||
|
body += '[2] ' + pkgbase_uri + '\n'
|
||||||
|
body += '[3] ' + merge_into_uri
|
||||||
else:
|
else:
|
||||||
body = '%s [1] filed a %s request for %s [2]:\n\n' \
|
body = '%s [1] filed a %s request for %s [2]:' % \
|
||||||
'%s\n\n[1] %s\n[2] %s\n' % \
|
(user, reqtype, pkgbase)
|
||||||
(user, reqtype, pkgbase, text, user_uri, pkgbase_uri)
|
body += '\n\n' + text + '\n\n'
|
||||||
|
body += '[1] ' + user_uri + '\n'
|
||||||
|
body += '[2] ' + pkgbase_uri + '\n'
|
||||||
thread_id = '<pkg-request-' + reqid + '@aur.archlinux.org>'
|
thread_id = '<pkg-request-' + reqid + '@aur.archlinux.org>'
|
||||||
|
|
||||||
send_notification(to, subject, body, cc, thread_id)
|
send_notification(to, subject, body, cc, thread_id)
|
||||||
|
|
Loading…
Add table
Reference in a new issue