##// END OF EJS Templates
fixes testing email in settings
marcink -
r1798:2ee93fba beta
parent child Browse files
Show More
@@ -228,7 +228,6 b' class SettingsController(BaseController)'
228 228 prefix_error=False,
229 229 encoding="UTF-8")
230 230
231
232 231 if setting_id == 'hooks':
233 232 ui_key = request.POST.get('new_hook_ui_key')
234 233 ui_value = request.POST.get('new_hook_ui_value')
@@ -242,7 +241,8 b' class SettingsController(BaseController)'
242 241 # check for edits
243 242 update = False
244 243 _d = request.POST.dict_of_lists()
245 for k, v in zip(_d.get('hook_ui_key', []), _d.get('hook_ui_value_new', [])):
244 for k, v in zip(_d.get('hook_ui_key', []),
245 _d.get('hook_ui_value_new', [])):
246 246 RhodeCodeUi.create_or_update_hook(k, v)
247 247 update = True
248 248
@@ -256,16 +256,18 b' class SettingsController(BaseController)'
256 256
257 257 return redirect(url('admin_edit_setting', setting_id='hooks'))
258 258
259
260
261 259 if setting_id == 'email':
262 260 test_email = request.POST.get('test_email')
263 261 test_email_subj = 'RhodeCode TestEmail'
264 262 test_email_body = 'RhodeCode Email test'
263
265 264 test_email_html_body = EmailNotificationModel()\
266 .get_email_tmpl(EmailNotificationModel.TYPE_DEFAULT)
265 .get_email_tmpl(EmailNotificationModel.TYPE_DEFAULT,
266 body=test_email_body)
267 267
268 run_task(tasks.send_email, [test_email], test_email_subj,
268 recipients = [test_email] if [test_email] else None
269
270 run_task(tasks.send_email, recipients, test_email_subj,
269 271 test_email_body, test_email_html_body)
270 272
271 273 h.flash(_('Email task created'), category='success')
General Comments 0
You need to be logged in to leave comments. Login now