Skip to content

Commit

Permalink
fix real-time email template for the Calendar section [CPCN-632]
Browse files Browse the repository at this point in the history
  • Loading branch information
devketanpro committed Aug 27, 2024
1 parent bd8e5a5 commit e7317b7
Show file tree
Hide file tree
Showing 4 changed files with 159 additions and 111 deletions.
41 changes: 22 additions & 19 deletions server/theme/email_agenda.fr_ca.html
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
<h1>{{ get_highlighted_field(item, ["headline", "name"]) | safe }}</h1>
<a href="{{ url_for_agenda(item) }}"><b>Voir cet élément dans votre compte: </b>{{ url_for_agenda(item) }}<br></a>

{% if item.event %}<p class="h3"><b>Quand: </b>{{ dateString }} {{get_event_state(item)}}</p>{% endif %}
<b>Voir cet élément dans votre compte : <a href="{{ url_for_agenda(item) }}">{{ url_for_agenda(item) }}</a></b><br>

{% if item.event %}
<p class="h3"><b>Quand : </b>{{ dateString }} {{get_event_state(item)}}</p>
{% endif %}

{% if location and location != '' %}
<p class="h3"><b>:</b> {{ location }}</p>
<p class="h3"><b> : </b>{{ location }}</p>
{% endif %}

{% if map and map != '' %}
<div><img style="height: auto!important; max-width: 700px!important; width: 100%!important"
src={{ map | safe }} ></div>
src={{ map | safe }}></div>
{% endif %}

{% if contacts | length is gt 0 %}
<p><b>Contact: </b>
<p><b>Contact : </b>
{% for contact in contacts %}
<div>{{ contact.name or contact.organisation }}
{{ contact.phone }}
Expand All @@ -24,59 +27,59 @@ <h1>{{ get_highlighted_field(item, ["headline", "name"]) | safe }}</h1>
{% endif %}

{% if links | length is gt 1 %}
<p><b>Web: </b>
<p><b>Web : </b>
{% for link in links %}
<div><a href={{ link | safe }}>{{ link }}</a><br></div>
{% endfor %}
</p>
{% endif %}

{% if item.definition_long or item.definition_short %}
<b>Description de l’événement: </b>
<b>Description de l’événement : </b>
<p>
{{ get_highlighted_field(item, ["definition_long", "definition_short"]) | safe }}
</p>
{% endif %}

{% for planning_item in item.get('planning_items', []) or [] %}
{% for planning_item in item.get('planning_items', []) or [] %}
<div>
<div>
<h3>Élément de couverture:</h3>
<h3>Élément de couverture :</h3>
{% if (planning_item.get('description_text') or planning_item.get('name') or '') != (item.definition_long or item.definition_short) %}
<p>
<b>Description de l’élément de planification: </b>{{ planning_item.get('description_text') or planning_item.get('name') or '' }}
<b>Description de l’élément de planification : </b>{{ planning_item.get('description_text') or planning_item.get('name') or '' }}
</p>
{% endif %}
</div>

{% if planning_item.get('ednote') %}
<div>
<strong>Note de la rédaction:</strong>
<strong>Note de la rédaction :</strong>
{{ planning_item.get('ednote') }}
</div>
{% endif %}

{% if planning_item.get('coverages', []) %}
<p>
<div>
<p><strong>Couverture:</strong></p>
<p><strong>Couverture :</strong></p>
</div>

{% for cov in get_planning_coverages(item, planning_item._id) %}
<div>
<p><b>Type de couverture: </b>{{get_coverage_content_type(cov,recipient_language)}}</p>
<p><b>Statut de couverture: </b>{{get_coverage_status(cov)}}</p>
<p><b>Date et heure d’échéance de la couverture: </b>{{get_coverage_date(cov)}}</p>
<p><b>Affecté à: </b>
<p><b>Type de couverture : </b>{{get_coverage_content_type(cov,recipient_language)}}</p>
<p><b>Statut de couverture : </b>{{get_coverage_status(cov)}}</p>
<p><b>Date et heure d’échéance de la couverture : </b>{{get_coverage_date(cov)}}</p>
<p><b>Affecté à : </b>
{% if cov.get('assigned_desk_name') %}{{cov['assigned_desk_name']}}{% endif %}
{% if cov.get('assigned_desk_email') %}<a href="mailto:{{cov['assigned_desk_email']}}?subject=Demande de couverture d’une utilisatrice de PC NouvellesPro: {{item.headline or item.name}}">{{cov['assigned_desk_email']}}</a>{% endif %}
{% if cov.get('assigned_desk_email') %}<a href="mailto:{{cov['assigned_desk_email']}}?subject=Demande de couverture d’une utilisatrice de PC NouvellesPro : {{item.headline or item.name}}">{{cov['assigned_desk_email']}}</a>{% endif %}
{% if cov.get('assigned_user_name') %}{{cov['assigned_user_name']}}{% endif %}
{% if cov.get('assigned_user_email') %}<a href="mailto:{{cov['assigned_desk_email']}}?subject=Demande de couverture d’une utilisatrice de PC NouvellesPro: {{item.headline or item.name}}">{{cov['assigned_user_email']}}</a>{% endif %}
{% if cov.get('assigned_user_email') %}<a href="mailto:{{cov['assigned_desk_email']}}?subject=Demande de couverture d’une utilisatrice de PC NouvellesPro : {{item.headline or item.name}}">{{cov['assigned_user_email']}}</a>{% endif %}
</p>
</div>
{% endfor %}
</p>
{% endif %}
</div>
{% endfor %}
<div><b>Sujet enregistré: {{ topic_name }}</b></div>
<div><b>Sujet enregistré : {{ topic_name }}</b></div>
76 changes: 49 additions & 27 deletions server/theme/email_agenda.fr_ca.txt
Original file line number Diff line number Diff line change
@@ -1,32 +1,54 @@
{{ item.headline or item.name }}
Voir cet élément dans votre compte: {{ url_for_agenda(item) }}
{% if item.event %}Quand: {{ dateString }} {{get_event_state(item)}}{% endif %}
{% if location and location != '' %}Où: {{ location }}
{% endif %}{% if contacts | length is gt 0 %}Contact: {% for contact in contacts %}{{ contact.name or contact.organisation }} {{ contact.phone }} {{ contact.mobile }} {{ contact.email }}
{% endfor %}
{% endif %}{% if links | length is gt 1 %}Web: {% for link in links %}{{ link }}
{% endfor %}
Voir cet élément dans votre compte : {{ url_for_agenda(item) }}
{% if item.event %}
Quand : {{ dateString }} {{get_event_state(item)}}
{% endif %}
{% if item.definition_long or item.definition_short %}Description de l’événement: {{ item.definition_long or item.definition_short }}

{% if location and location != '' %}
Où : {{ location }}
{% endif %}
{% for planning_item in item.get('planning_items', []) or [] %}
Élément de couverture:
{%- if (planning_item.get('description_text') or planning_item.get('name') or '') != (item.definition_long or item.definition_short) %}
Description de l’élément de planification: {{ planning_item.get('description_text') or planning_item.get('name') or '' }}
{% endif -%}
{% if planning_item.get('ednote') %}Note de la rédaction: {{ planning_item.get('ednote') }}{% endif %}
{% if planning_item.get('coverages', []) | length is gt 0 %}
Couverture:
{% for cov in get_planning_coverages(item, planning_item._id) %}
Type de couverture: {{get_coverage_content_type(cov,recipient_language)}}
Statut de couverture: {{get_coverage_status(cov)}}
Date et heure d’échéance de la couverture: {{get_coverage_date(cov)}}
Affecté à:
{% if cov.get('assigned_desk_name')%}{{cov['assigned_desk_name']}}{% endif %}
{% if cov.get('assigned_desk_email') %}{{cov['assigned_desk_email']}}{% endif %}
{% if cov.get('assigned_user_name') %}{{cov['assigned_user_name']}}{% endif %}
{% if cov.get('assigned_user_email') %}{{cov['assigned_user_email']}}{% endif %}
{% endfor %}

{% if contacts | length is gt 0 %}
Contact :
{% for contact in contacts %}
{{ contact.name or contact.organisation }} {{ contact.phone }} {{ contact.mobile }} {{ contact.email }}
{% endfor %}
{% endif %}

{% if links | length is gt 1 %}
Web :
{% for link in links %}
{{ link }}
{% endfor %}
{% endif %}

{% if item.definition_long or item.definition_short %}
Description de l’événement : {{ item.definition_long or item.definition_short }}
{% endif %}

{% for planning_item in item.get('planning_items', []) or [] %}
Élément de couverture :
{%- if (planning_item.get('description_text') or planning_item.get('name') or '') != (item.definition_long or item.definition_short) %}
Description de l’élément de planification : {{ planning_item.get('description_text') or planning_item.get('name') or '' }}
{% endif -%}

{% if planning_item.get('ednote') %}
Note de la rédaction : {{ planning_item.get('ednote') }}
{% endif %}

{% if planning_item.get('coverages', []) | length is gt 0 %}
Couverture :
{% for cov in get_planning_coverages(item, planning_item._id) %}
Type de couverture : {{ get_coverage_content_type(cov, recipient_language) }}
Statut de couverture : {{ get_coverage_status(cov) }}
Date et heure d’échéance de la couverture : {{ get_coverage_date(cov) }}
Affecté à :
{% if cov.get('assigned_desk_name') %}{{ cov['assigned_desk_name'] }}{% endif %}
{% if cov.get('assigned_desk_email') %}{{ cov['assigned_desk_email'] }}{% endif %}
{% if cov.get('assigned_user_name') %}{{ cov['assigned_user_name'] }}{% endif %}
{% if cov.get('assigned_user_email') %}{{ cov['assigned_user_email'] }}{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
Sujet enregistré: {{ topic_name }}

Sujet enregistré : {{ topic_name }}
74 changes: 37 additions & 37 deletions server/theme/email_agenda.html
Original file line number Diff line number Diff line change
@@ -1,77 +1,77 @@
<h1>{{ get_highlighted_field(item, ["headline", "name"]) | safe }}</h1>
<a href="{{ url_for_agenda(item) }}"><b>View this item in your account: </b>{{ url_for_agenda(item) }} <br></a>
{% if item.event %}<p class="h3"><b>When:</b>{{ dateString }} {{get_event_state(item)}}</p>{% endif %}

<b>View this item in your account : <a href="{{ url_for_agenda(item) }}">{{ url_for_agenda(item) }}</a></b><br>

{% if item.event %}
<p class="h3"><b>When : </b>{{ dateString }} {{ get_event_state(item) }}</p>
{% endif %}

{% if location and location != '' %}
<p class="h3"><b>Where:</b> {{ location }}</p>
<p class="h3"><b>Where : </b>{{ location }}</p>
{% endif %}

{% if map and map != '' %}
<div><img style="height: auto!important; max-width: 700px!important; width: 100%!important"
src={{ map | safe }} ></div>
<div>
<img style="height: auto!important; max-width: 700px!important; width: 100%!important" src={{ map | safe }}>
</div>
{% endif %}

{% if contacts | length is gt 0 %}
<p><b>Contact: </b>
<p><b>Contact : </b>
{% for contact in contacts %}
<div>{{ contact.name or contact.organisation }}
{{ contact.phone }}
{{ contact.mobile }}
{{ contact.email }}</div>
<div>
{{ contact.name or contact.organisation }}<br>
{{ contact.phone }}<br>
{{ contact.mobile }}<br>
{{ contact.email }}
</div>
{% endfor %}
</p>
</p><br>
{% endif %}

{% if links | length is gt 1 %}
<p><b>Web: </b>
<p><b>Web : </b>
{% for link in links %}
<div><a href={{ link | safe }}>{{ link }}</a><br></div>
{% endfor %}
</p>
{% endif %}

{% if item.definition_long or item.definition_short %}
<b>Event description: </b>
<p>
{{ get_highlighted_field(item, ["definition_long", "definition_short"]) | safe }}
</p>
<b>Event description : </b>
<p>{{ get_highlighted_field(item, ["definition_long", "definition_short"]) | safe }}</p>
{% endif %}

{% for planning_item in item.get('planning_items', []) or [] %}
{% for planning_item in item.get('planning_items', []) or [] %}
<div>
<div>
<h3>Planning item:</h3>
{% if (planning_item.get('description_text') or planning_item.get('name') or '') != (item.definition_long or item.definition_short) %}
<p>
<b>Planning item description:</b> {{ planning_item.get('description_text') or planning_item.get('name') or '' }}
</p>
{% endif %}
</div>
<h3>Planning item : </h3>
{% if (planning_item.get('description_text') or planning_item.get('name') or '') != (item.definition_long or item.definition_short) %}
<p><b>Planning item description : </b>{{ planning_item.get('description_text') or planning_item.get('name') or '' }}</p>
{% endif %}

{% if planning_item.get('ednote') %}
<div>
<strong>Editorial Note:</strong>
{{ planning_item.get('ednote') }}
<strong>Editorial Note : </strong>{{ planning_item.get('ednote') }}
</div>
{% endif %}

{% if planning_item.get('coverages', []) %}
<p>
<div>
<p><strong>Coverage:</strong></p>
<p><strong>Coverage : </strong></p>
</div>

{% for cov in get_planning_coverages(item, planning_item._id) %}
<div>
<p><b>Type of coverage: </b>{{get_coverage_content_type(cov,recipient_language)}}</p>
<p><b>Coverage status: </b>{{get_coverage_status(cov)}}</p>
<p><b>Coverage due date & time: </b>{{get_coverage_date(cov)}}</p>
<p><b>Type of coverage : </b>{{ get_coverage_content_type(cov, recipient_language) }}</p>
<p><b>Coverage status : </b>{{ get_coverage_status(cov) }}</p>
<p><b>Coverage due date & time : </b>{{ get_coverage_date(cov) }}</p>
{% if cov.get('assigned_desk_name') or cov.get('assigned_desk_email') or cov.get('assigned_user_name') or cov.get('assigned_user_email') %}
<p><b>Assigned to:</b>
{% if cov.get('assigned_desk_name') %}{{cov['assigned_desk_name']}}{% endif %}
{% if cov.get('assigned_desk_email') %}<a href="mailto:{{cov['assigned_desk_email']}}?subject=Coverage inquiry from CP NewsPro user: {{item.headline or item.name}}">{{cov['assigned_desk_email']}}</a>{% endif %}
{% if cov.get('assigned_user_name') %}{{cov['assigned_user_name']}}{% endif %}
{% if cov.get('assigned_user_email') %}<a href="mailto:{{cov['assigned_desk_email']}}?subject=Coverage inquiry from CP NewsPro user: {{item.headline or item.name}}">{{cov['assigned_user_email']}}</a>{% endif %}
<p><b>Assigned to : </b>
{% if cov.get('assigned_desk_name') %}{{ cov['assigned_desk_name'] }}{% endif %}
{% if cov.get('assigned_desk_email') %}<a href="mailto:{{ cov['assigned_desk_email'] }}?subject=Coverage inquiry from CP NewsPro user: {{ item.headline or item.name }}">{{ cov['assigned_desk_email'] }}</a>{% endif %}
{% if cov.get('assigned_user_name') %}{{ cov['assigned_user_name'] }}{% endif %}
{% if cov.get('assigned_user_email') %}<a href="mailto:{{ cov['assigned_desk_email'] }}?subject=Coverage inquiry from CP NewsPro user: {{ item.headline or item.name }}">{{ cov['assigned_user_email'] }}</a>{% endif %}
</p>
{% endif %}
</div>
Expand All @@ -81,4 +81,4 @@ <h3>Planning item:</h3>
</div>
{% endfor %}

<div><b>Saved topic: {{ topic_name }}</b></div>
<div><b>Saved topic : {{ topic_name }}</b></div>
79 changes: 51 additions & 28 deletions server/theme/email_agenda.txt
Original file line number Diff line number Diff line change
@@ -1,33 +1,56 @@
{{ item.headline or item.name }}
View this item in your account: {{ url_for_agenda(item) }}
{% if item.event %}When: {{ dateString }} {{get_event_state(item)}}{% endif %}
{% if location and location != '' %}Where: {{ location }}{% endif %}
{% if contacts | length is gt 0 %}Contact: {% for contact in contacts %}{{ contact.name or contact.organisation }} {{ contact.phone }} {{ contact.mobile }} {{ contact.email }}
{% endfor %}
{% endif %}{% if links | length is gt 1 %}Web: {% for link in links %}{{ link }}
{% endfor %}

View this item in your account : {{ url_for_agenda(item) }}

{% if item.event %}
When : {{ dateString }} {{ get_event_state(item) }}
{% endif %}
{% if item.definition_long or item.definition_short %}Event description: {{ item.definition_long or item.definition_short }}

{% if location and location != '' %}
Where : {{ location }}
{% endif %}
{% for planning_item in item.get('planning_items', []) or [] %}
Planning Item:
{%- if (planning_item.get('description_text') or planning_item.get('name') or '') != (item.definition_long or item.definition_short) %}
Planning item description: {{ planning_item.get('description_text') or planning_item.get('name') or '' }}
{% endif -%}
{% if planning_item.get('ednote') %}Editorial Note: {{ planning_item.get('ednote') }}
{% endif -%}
{% if planning_item.get('coverages', []) | length is gt 0 %}
Coverages:
{% for cov in get_planning_coverages(item, planning_item._id) %}
Type of coverage:{{get_coverage_content_type(cov,recipient_language)}}
Coverage status: {{get_coverage_status(cov)}}
Coverage due date & time: {{get_coverage_date(cov)}}
Assigned to:
{% if cov.get('assigned_desk_name') %}{{cov['assigned_desk_name']}}{% endif %}
{% if cov.get('assigned_desk_email') %}{{cov['assigned_desk_email']}}{% endif %}
{% if cov.get('assigned_user_name') %}{{cov['assigned_user_name']}}{% endif %}
{% if cov.get('assigned_user_email') %}{{cov['assigned_user_email']}}{% endif %}
{% endfor %}

{% if contacts | length is gt 0 %}
Contact :
{% for contact in contacts %}
{{ contact.name or contact.organisation }} {{ contact.phone }} {{ contact.mobile }} {{ contact.email }}
{% endfor %}
{% endif %}

{% if links | length is gt 1 %}
Web :
{% for link in links %}
{{ link }}
{% endfor %}
{% endif %}

{% if item.definition_long or item.definition_short %}
Event description : {{ item.definition_long or item.definition_short }}
{% endif %}

{% for planning_item in item.get('planning_items', []) or [] %}
Planning Item :
{%- if (planning_item.get('description_text') or planning_item.get('name') or '') != (item.definition_long or item.definition_short) %}
Planning item description : {{ planning_item.get('description_text') or planning_item.get('name') or '' }}
{% endif -%}

{% if planning_item.get('ednote') %}
Editorial Note : {{ planning_item.get('ednote') }}
{% endif %}

{% if planning_item.get('coverages', []) | length is gt 0 %}
Coverages :
{% for cov in get_planning_coverages(item, planning_item._id) %}
Type of coverage : {{ get_coverage_content_type(cov, recipient_language) }}
Coverage status : {{ get_coverage_status(cov) }}
Coverage due date & time : {{ get_coverage_date(cov) }}
Assigned to :
{% if cov.get('assigned_desk_name') %}{{ cov['assigned_desk_name'] }}{% endif %}
{% if cov.get('assigned_desk_email') %}{{ cov['assigned_desk_email'] }}{% endif %}
{% if cov.get('assigned_user_name') %}{{ cov['assigned_user_name'] }}{% endif %}
{% if cov.get('assigned_user_email') %}{{ cov['assigned_user_email'] }}{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
Saved topic: {{ topic_name }}

Saved topic : {{ topic_name }}

0 comments on commit e7317b7

Please sign in to comment.