diff --git a/insight/tasks/weekly_newsletter_batch.py b/insight/tasks/weekly_newsletter_batch.py index 8201da8..add0cbf 100644 --- a/insight/tasks/weekly_newsletter_batch.py +++ b/insight/tasks/weekly_newsletter_batch.py @@ -145,8 +145,8 @@ def _get_weekly_trend_html(self) -> str: # 템플릿 렌더링이 제대로 되지 않은 경우 배치 종료 if ( - "이 주의 트렌딩 글" not in weekly_trend_html - or "트렌드 분석" not in weekly_trend_html + "이번 주의 트렌딩 글" not in weekly_trend_html + or "주간 트렌드 분석" not in weekly_trend_html ): logger.error( f"Failed to build weekly trend HTML for newsletter #{weekly_trend['id']}" diff --git a/insight/tests/conftest.py b/insight/tests/conftest.py index e0941a8..cc936b2 100644 --- a/insight/tests/conftest.py +++ b/insight/tests/conftest.py @@ -160,9 +160,9 @@ def sample_newsletter(user): email_message=EmailMessage( to=[user.email], from_email=settings.DEFAULT_FROM_EMAIL, - subject="Test Newsletter", - text_body="Test content", - html_body="
-
{% if user and insight.user_weekly_stats %}
- 사용자 주간 통계-
+ 사용자 주간 통계+전체 게시글 수: {{ insight.user_weekly_stats.posts }} 새 게시글 수: {{ insight.user_weekly_stats.new_posts }} 조회수 증가: {{ insight.user_weekly_stats.views }} @@ -10,8 +10,8 @@사용자 주간 통계{% endif %} {% if insight.trend_analysis %} -트렌드 분석-
+ 트렌드 분석+
{% if insight.trend_analysis.hot_keywords %}
{% endif %}
{% if insight.trending_summary %}
- 핵심 키워드{{ insight.trend_analysis.hot_keywords|join:", " }} @@ -21,42 +21,42 @@핵심 키워드{% if insight.trend_analysis.title_trends %}제목 트렌드-{{ insight.trend_analysis.title_trends }} +{{ insight.trend_analysis.title_trends }} {% endif %} {% if insight.trend_analysis.content_trends %}콘텐츠 트렌드-{{ insight.trend_analysis.content_trends }} +{{ insight.trend_analysis.content_trends }} {% endif %} {% if insight.trend_analysis.insights %}인사이트-{{ insight.trend_analysis.insights }} +{{ insight.trend_analysis.insights }} {% endif %}{% if user %}작성 게시글 요약{% else %}트렌딩 요약{% endif %}+{% if user %}작성 게시글 요약{% else %}트렌딩 요약{% endif %}{% for item in insight.trending_summary %} -
- {{ forloop.counter }}. {{ item.title }}-{{ item.summary }} +
+
{% endfor %}
{% endif %}
{% if user and insight.user_weekly_reminder %}
- {{ forloop.counter }}. {{ item.title }}+{{ item.summary }} {% if item.key_points %}핵심 키워드: {{ item.key_points|join:", " }} {% endif %}작성자: {{ item.username }} URL: https://velog.io/@{{item.username}}/{{item.slug}} {% if item.thumbnail %} -썸네일: 썸네일: 리마인더-
+ 리마인더+마지막 작성 글: {{ insight.user_weekly_reminder.title }} 마지막 작성일: {{ insight.user_weekly_reminder.days_ago }}일 전
- {% if insight.trending_summary or insight.user_weekly_stats or insight.reminder %}
- - - 📝 - {% if user.username %} - {{user.username}}님의 - {% else %} - 내 - {% endif %} - 활동 리포트 -- {% endif %} - - {% if insight.user_weekly_stats %} -
-
- {% endif %}
+
- 저번 주에는
- {% if insight.user_weekly_stats.new_posts > 0 %}
- {{insight.user_weekly_stats.new_posts}}개의 글을 작성하셨네요! 👏
- {% if insight.user_weekly_reminder %}
-
\ No newline at end of file
diff --git a/templates/insights/weekly_trend.html b/templates/insights/weekly_trend.html
index 993ffc0..6ce622e 100644
--- a/templates/insights/weekly_trend.html
+++ b/templates/insights/weekly_trend.html
@@ -1,89 +1,96 @@
-
-
- {% endif %}
-
- {% if insight.trending_summary %}
- - 마지막으로 글을 작성하신지 {{insight.user_weekly_reminder.days_ago}}일이 지났어요 😭 - -
- 지난번엔 "{{insight.user_weekly_reminder.title}}" 라는 제목의 글을 작성하셨네요! - 이번 주에 쓴 글 -- {% for item in insight.trending_summary %} -
-
- {% endfor %}
- {% endif %}
+ {% if insight.trending_summary or insight.user_weekly_stats or insight.user_weekly_reminder %}
+
- {% if item.thumbnail %}
-
-
- {% endif %}
-
-
-
- {% if item.thumbnail %}
-
-
- {% else %}
- |