Skip to content

Commit

Permalink
replace level management email
Browse files Browse the repository at this point in the history
  • Loading branch information
evemartin committed May 7, 2024
1 parent d466b3a commit 9064b6c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 28 deletions.
28 changes: 11 additions & 17 deletions game/level_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,10 @@
from builtins import str
from itertools import chain

from common.helpers.emails import NOTIFICATION_EMAIL, send_email
from common.mail import campaign_ids, send_dotdigital_email

from game.character import get_character_by_pk
from game.decor import get_decor_element
from game.messages import (
level_creation_email_subject,
level_creation_email_text_content,
)
from game.theme import get_theme_by_pk
from .models import Block, LevelBlock, LevelDecor

Expand Down Expand Up @@ -191,16 +187,14 @@ def email_new_custom_level(
teacher_email, moderate_url, level_url, home_url, student_name, class_name
):
# email teacher when a new custom level is created by a pupil, so it can be moderated ASAP
send_email(
NOTIFICATION_EMAIL,
[teacher_email],
level_creation_email_subject(),
level_creation_email_text_content().format(
moderate_url=moderate_url,
level_url=level_url,
student_name=student_name,
class_name=class_name,
home_url=home_url,
),
level_creation_email_subject(),

send_dotdigital_email(
campaign_ids["level_creation"],
[teacher_email],
personalization_values={
"STUDENT_NAME": student_name,
"CLASS_NAME": class_name,
"LEVEL_URL": level_url,
"MODERATE_URL": moderate_url
}
)
11 changes: 0 additions & 11 deletions game/messages.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
from builtins import str


def level_creation_email_subject():
return "Custom level to moderate"


def level_creation_email_text_content():
return (
"Your student {student_name} from your class {class_name} has created this level: {level_url}. "
"If you want to moderate it, you can do it on the moderation board: {moderate_url}."
)


def youtube_link(url, border):
return (
"<div class='popup_video'>"
Expand Down

0 comments on commit 9064b6c

Please sign in to comment.