Skip to content

Commit

Permalink
fix short name issue in email template (#1427)
Browse files Browse the repository at this point in the history
  • Loading branch information
celestemartinez authored Oct 19, 2022
1 parent 3171073 commit e01ba4a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions openreview/conference/invitation.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def __init__(self, conference, under_submission):

if submission_stage.submission_email:
email_template = submission_stage.submission_email
email_template = email_template.replace('{{Abbreviated_Venue_Name}}', conference.get_short_name())
email_template = email_template.replace('{{action}}', '{action}')
email_template = email_template.replace('{{note_title}}', '{note.content[\'title\']}')
email_template = email_template.replace('{{note_abstract}}', '{note_abstract}')
Expand Down
2 changes: 1 addition & 1 deletion openreview/venue_request/venue_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def setup_venue_revision(self):
revision_content['submission_email'] = {
'order': 20,
'description': 'Please review the email sent to authors when a submission is posted. Make sure not to remove the parenthesized tokens.',
'default': f'''Your submission to ${self.venue_request.request_content['Abbreviated Venue Name']} has been {{action}}.\n\nSubmission Number: {{note_number}} \n\nTitle: {{note_title}} {{note_abstract}} \n\nTo view your submission, click here: https://openreview.net/forum?id={{note_forum}}''',
'default': '''Your submission to {{Abbreviated_Venue_Name}} has been {{action}}.\n\nSubmission Number: {{note_number}} \n\nTitle: {{note_title}} {{note_abstract}} \n\nTo view your submission, click here: https://openreview.net/forum?id={{note_forum}}''',
'value-regex':'[\\S\\s]{1,10000}',
'hidden': True
}
Expand Down
3 changes: 2 additions & 1 deletion tests/test_venue_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ def test_venue_revision(self, client, test_client, selenium, request_page, venue
'value-regex': '.*'
}
},
'submission_email': 'Your submission to TestVenue@OR\'2030 has been {{action}}.\n\nSubmission Number: {{note_number}}\n\nTitle: {{note_title}} {{note_abstract}}\n\nTo view your submission, click here: https://openreview.net/forum?id={{note_forum}}\n\nThis is some extra information to be added at the end of the email template.',
'submission_email': 'Your submission to {{Abbreviated_Venue_Name}} has been {{action}}.\n\nSubmission Number: {{note_number}}\n\nTitle: {{note_title}} {{note_abstract}}\n\nTo view your submission, click here: https://openreview.net/forum?id={{note_forum}}\n\nThis is some extra information to be added at the end of the email template.',
'reviewer_roles': ['Reviewers', 'Expert_Reviewers']
},
forum=venue['request_form_note'].forum,
Expand Down Expand Up @@ -930,6 +930,7 @@ def test_venue_matching_setup(self, client, test_client, selenium, request_page,
assert messages and len(messages) == 1
assert 'This is some extra information to be added at the end of the email template.' in messages[0]['content']['text']
assert 'Title: test submission' in messages[0]['content']['text']
assert 'Your submission to TestVenue@OR\'2030 has been posted.'

messages = client.get_messages(subject='{} has received a new submission titled {}'.format(venue['request_form_note'].content['Abbreviated Venue Name'], submission.content['title']))
assert messages and len(messages) == 3
Expand Down

0 comments on commit e01ba4a

Please sign in to comment.