[root] add service to the field passed to email templates

Now you can personnalize email notifications with respect to the
requesting service.
This commit is contained in:
Benjamin Dauvergne 2011-01-27 13:40:51 +00:00
parent 57faf703cb
commit 9385fd3d3d
1 changed files with 7 additions and 4 deletions

View File

@ -832,6 +832,7 @@ class RootDirectory(Directory):
'email': identity.email,
'email_as_username': str(identities_cfg.get('email-as-username', False)),
'username': identity.accounts[0].username,
'service': get_session().service,
}
emails.custom_ezt_email('new-registration-admin-notification', data,
@ -878,6 +879,7 @@ administrator'))
'email_as_username': str(identities_cfg.get('email-as-username')),
'username': identity.accounts[0].username,
'password': password,
'service': get_session().service,
}
if welcome:
@ -1115,6 +1117,7 @@ administrator'))
'hostname': get_request().get_server(),
'email': email,
'usernames': usernames,
'service': get_session().service,
}
get_logger().info('Forgot identifier: reminded email %r of its accounts' % email)
try:
@ -1282,7 +1285,7 @@ TextsDirectory.register('federations',
EmailsDirectory.register('welcome-email',
N_('Welcome Email'),
N_('Available variables: hostname, identity, username, password, email_as_username'),
N_('Available variables: %s') % 'hostname, identity, username, password, email_as_username, service',
default_subject = N_('Welcome to [hostname]'),
default_body = N_('''\
Welcome to [hostname],
@ -1293,7 +1296,7 @@ Your password is: [password]
EmailsDirectory.register('password-email',
N_('Password Reminder'),
N_('Available variables: hostname, identity, email, username, password, email_as_username'),
N_('Available variables: %s') % 'hostname, identity, email, username, password, email_as_username, service',
default_subject = N_('Your account on [hostname]'),
default_body = N_('''\
Hello,
@ -1310,7 +1313,7 @@ Your password is: [password]
EmailsDirectory.register('new-registration-admin-notification',
N_('Notification of new registration to administrators'),
N_('Available variables: hostname, identity, email, email_as_username, username'),
N_('Available variables: %s') % 'hostname, identity, email, email_as_username, username, service',
default_subject = N_('New Registration'),
default_body = N_('''\
Hello,
@ -1325,7 +1328,7 @@ A new user registered on [hostname].
EmailsDirectory.register('identifier-email',
N_('Identifier Email'),
N_('Available variables: hostname, usernames, email'),
N_('Available variables: %s') % 'hostname, usernames, email, service',
default_subject = N_('List of identifiers for [email] on [hostname]'),
default_body = N_('''\
You asked for all usernames linked to address [email] on [hostname].