Skip to content

Commit

Permalink
Add owner email as reply-to header (#796)
Browse files Browse the repository at this point in the history
* ➕ Add owner email as reply-to for invitation and new booking

* ➕ Change email footer with hint on reply

* Break email footer reply hint into two lines and remove email address.

---------

Co-authored-by: Melissa Autumn <[email protected]>
  • Loading branch information
devmount and MelissaAutumn authored Dec 17, 2024
1 parent 834aef4 commit 84236ec
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 5 deletions.
2 changes: 2 additions & 0 deletions backend/src/appointment/controller/mailer.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ def __init__(self, *args, **kwargs):
'plain': l10n('invite-mail-plain'),
}
super().__init__(*args, **default_kwargs, **kwargs)
self.reply_to = self.email

def html(self):
return get_template('invite.jinja2').render(
Expand Down Expand Up @@ -334,6 +335,7 @@ def __init__(self, name, email, date, duration, schedule_name, *args, **kwargs):
self.schedule_name = schedule_name
default_kwargs = {'subject': l10n('new-booking-subject', {'name': name})}
super().__init__(name=name, email=email, date=date, duration=duration, *args, **default_kwargs, **kwargs)
self.reply_to = email

def text(self):
return l10n(
Expand Down
3 changes: 3 additions & 0 deletions backend/src/appointment/l10n/de/email.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
mail-brand-contact-form = Kontaktformular
mail-brand-support-hint = Du hast Fragen? Wir helfen gern. Nutze unser { $contact_form_link }, oder antworte einfach auf diese E-Mail für Support.
mail-brand-reply-hint = Du hast Fragen? Wir helfen gern, Du erreichst uns über unser { $contact_form_link }.
mail-brand-reply-hint-attendee-info = Du möchtest { $name } kontaktieren? Antworte einfach auf diese E-Mail.
mail-brand-footer = Diese Nachricht wurde gesendet von:
{-brand-name}
{-brand-slogan} {-brand-sign-up-with-no-url}
Expand Down
3 changes: 3 additions & 0 deletions backend/src/appointment/l10n/en/email.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
mail-brand-contact-form = contact form
mail-brand-support-hint = Got questions? We're here to help. Fill out our { $contact_form_link }, or simply reply to this email for support.
mail-brand-reply-hint = Got questions? We're here to help, you can reach us via our { $contact_form_link }.
mail-brand-reply-hint-attendee-info = Need to get in touch with { $name }? Simply reply to this email.
mail-brand-footer = This message was sent from:
{-brand-name}
{-brand-slogan} {-brand-sign-up-with-no-url}
Expand Down
2 changes: 1 addition & 1 deletion backend/src/appointment/templates/email/confirm.jinja2
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% extends "includes/base.jinja2" %}
{% set show_contact_form_hint = True %}
{% set show_contact_form_support_hint = True %}
{# Helper vars #}
{% set clock_image_small = '<img style="width: 11px; height: 11px; position: relative; top: 2px;" alt="" src="cid:%(cid)s" />'|format(cid=clock_icon_cid) %}
{% set clock_image = '<img style="width: 15px; height: 15px; position: relative; top: 2px;" alt="" src="cid:%(cid)s" />'|format(cid=clock_icon_cid) %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% extends "includes/base.jinja2" %}
{% set show_contact_form_hint = True %}
{% set show_contact_form_support_hint = True %}
{# Code begins! #}
{% block introduction %}
<div style="color: {{ colour_text_base }}; text-align: center; line-height: 16px;">
Expand Down
10 changes: 9 additions & 1 deletion backend/src/appointment/templates/email/includes/base.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,20 @@
{% block call_to_action %}{% endblock %}
</div>
{% endif %}
{% if show_contact_form_hint %}
{% if show_contact_form_support_hint %}
{% set link = '<a href="%(url)s">%(label)s</a>'|format(url=homepage_url + '/contact', label=l10n('mail-brand-contact-form')) %}
<div style="text-align: center; margin-left: auto; margin-right: auto; margin-bottom: 24px; padding: 12px; max-width: 310px;">
{{ l10n('mail-brand-support-hint', {'contact_form_link': link})|safe }}
</div>
{% endif %}
{% if show_contact_form_reply_hint %}
{% set link = '<a href="%(url)s">%(label)s</a>'|format(url=homepage_url + '/contact', label=l10n('mail-brand-contact-form')) %}
<div style="text-align: center; margin-left: auto; margin-right: auto; margin-bottom: 24px; padding: 12px; max-width: 310px;">
{{ l10n('mail-brand-reply-hint-attendee-info', { 'name': name })|safe }}
<br/><br/>
{{ l10n('mail-brand-reply-hint', {'contact_form_link': link})|safe }}
</div>
{% endif %}
<div style="
display: block;
width: 100%;
Expand Down
1 change: 1 addition & 0 deletions backend/src/appointment/templates/email/invite.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
{% set clock_image_small = '<img style="width: 11px; height: 11px; position: relative; top: 2px;" alt="" src="cid:%(cid)s" />'|format(cid=clock_icon_cid) %}
{% set clock_image = '<img style="width: 15px; height: 15px; position: relative; top: 2px;" alt="" src="cid:%(cid)s" />'|format(cid=clock_icon_cid) %}
{% set calendar_image = '<img style="width: 14px; height: 14px; position: relative; top: 2px;" alt="" src="cid:%(cid)s" />'|format(cid=calendar_icon_cid) %}
{% set show_contact_form_reply_hint = True %}
{# Code begins! #}
{% block introduction %}
<div style="color: {{ colour_text_base }}; text-align: center; line-height: 16px;">
Expand Down
2 changes: 1 addition & 1 deletion backend/src/appointment/templates/email/new_account.jinja2
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% extends "includes/base.jinja2" %}
{% set show_contact_form_hint = True %}
{% set show_contact_form_support_hint = True %}
{# Code begins! #}
{% block introduction %}
<div style="color: {{ colour_text_base }}; text-align: center; line-height: 16px;">
Expand Down
2 changes: 1 addition & 1 deletion backend/src/appointment/templates/email/new_booking.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% set clock_image_small = '<img style="width: 11px; height: 11px; position: relative; top: 2px;" alt="" src="cid:%(cid)s" />'|format(cid=clock_icon_cid) %}
{% set clock_image = '<img style="width: 15px; height: 15px; position: relative; top: 2px;" alt="" src="cid:%(cid)s" />'|format(cid=clock_icon_cid) %}
{% set calendar_image = '<img style="width: 14px; height: 14px; position: relative; top: 2px;" alt="" src="cid:%(cid)s" />'|format(cid=calendar_icon_cid) %}
{% set show_contact_form_hint = True %}
{% set show_contact_form_reply_hint = True %}
{# Code begins! #}
{% block introduction %}
<div style="color: {{ colour_text_base }}; text-align: center; line-height: 16px;">
Expand Down

0 comments on commit 84236ec

Please sign in to comment.