|
@@ -357,22 +357,22 @@ class EmailManager(object):
|
357
|
357
|
text_template_file_path = self.config.EMAIL_NOTIFICATION_CREATED_ACCOUNT_TEMPLATE_TEXT # nopep8
|
358
|
358
|
html_template_file_path = self.config.EMAIL_NOTIFICATION_CREATED_ACCOUNT_TEMPLATE_HTML # nopep8
|
359
|
359
|
|
|
360
|
+ context = {
|
|
361
|
+ 'user': user,
|
|
362
|
+ 'password': password,
|
|
363
|
+ # TODO - G.M - 11-06-2018 - [emailTemplateURL] correct value for logo_url # nopep8
|
|
364
|
+ 'logo_url': '',
|
|
365
|
+ # TODO - G.M - 11-06-2018 - [emailTemplateURL] correct value for login_url # nopep8
|
|
366
|
+ 'login_url': self.config.WEBSITE_BASE_URL,
|
|
367
|
+ }
|
360
|
368
|
body_text = self._render_template(
|
361
|
369
|
mako_template_filepath=text_template_file_path,
|
362
|
|
- context={
|
363
|
|
- 'user': user,
|
364
|
|
- 'password': password,
|
365
|
|
- 'login_url': self.config.WEBSITE_BASE_URL,
|
366
|
|
- }
|
|
370
|
+ context=context
|
367
|
371
|
)
|
368
|
372
|
|
369
|
373
|
body_html = self._render_template(
|
370
|
374
|
mako_template_filepath=html_template_file_path,
|
371
|
|
- context={
|
372
|
|
- 'user': user,
|
373
|
|
- 'password': password,
|
374
|
|
- 'login_url': self.config.WEBSITE_BASE_URL,
|
375
|
|
- }
|
|
375
|
+ context=context,
|
376
|
376
|
)
|
377
|
377
|
|
378
|
378
|
part1 = MIMEText(body_text, 'plain', 'utf-8')
|
|
@@ -433,6 +433,15 @@ class EmailManager(object):
|
433
|
433
|
content_text = ''
|
434
|
434
|
call_to_action_text = ''
|
435
|
435
|
|
|
436
|
+ # TODO - G.M - 11-06-2018 - [emailTemplateURL] correct value for call_to_action_url # nopep8
|
|
437
|
+ call_to_action_url =''
|
|
438
|
+ # TODO - G.M - 11-06-2018 - [emailTemplateURL] correct value for status_icon_url # nopep8
|
|
439
|
+ status_icon_url = ''
|
|
440
|
+ # TODO - G.M - 11-06-2018 - [emailTemplateURL] correct value for workspace_url # nopep8
|
|
441
|
+ workspace_url = ''
|
|
442
|
+ # TODO - G.M - 11-06-2018 - [emailTemplateURL] correct value for logo_url # nopep8
|
|
443
|
+ logo_url = ''
|
|
444
|
+
|
436
|
445
|
action = content.get_last_action().id
|
437
|
446
|
if ActionDescription.COMMENT == action:
|
438
|
447
|
content_intro = l_('<span id="content-intro-username">{}</span> added a comment:').format(actor.display_name)
|
|
@@ -522,20 +531,25 @@ class EmailManager(object):
|
522
|
531
|
)
|
523
|
532
|
raise ValueError('Unexpected empty notification')
|
524
|
533
|
|
|
534
|
+ context = {
|
|
535
|
+ 'user': role.user,
|
|
536
|
+ 'workspace': role.workspace,
|
|
537
|
+ 'workspace_url': workspace_url,
|
|
538
|
+ 'main_title': main_title,
|
|
539
|
+ 'status_label': content.get_status().label,
|
|
540
|
+ 'status_icon_url': status_icon_url,
|
|
541
|
+ 'role_label': role.role_as_label(),
|
|
542
|
+ 'content_intro': content_intro,
|
|
543
|
+ 'content_text': content_text,
|
|
544
|
+ 'call_to_action_text': call_to_action_text,
|
|
545
|
+ 'call_to_action_url': call_to_action_url,
|
|
546
|
+ 'logo_url': logo_url,
|
|
547
|
+ }
|
525
|
548
|
user = role.user
|
526
|
549
|
workspace = role.workspace
|
527
|
550
|
body_content = self._render_template(
|
528
|
551
|
mako_template_filepath=mako_template_filepath,
|
529
|
|
- context={
|
530
|
|
- 'user': role.user,
|
531
|
|
- 'workspace': role.workspace,
|
532
|
|
- 'main_title': main_title,
|
533
|
|
- 'status': content.get_status().label,
|
534
|
|
- 'role': role.role_as_label(),
|
535
|
|
- 'content_intro': content_intro,
|
536
|
|
- 'content_text': content_text,
|
537
|
|
- 'call_to_action_text': call_to_action_text,
|
538
|
|
- }
|
|
552
|
+ context=context,
|
539
|
553
|
)
|
540
|
554
|
return body_content
|
541
|
555
|
|