-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ŝanĝas la retpoŝtan provizanton al Postmark per Anymail
adiaŭ SendGrid!
- Loading branch information
Showing
25 changed files
with
341 additions
and
66 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from django.apps import AppConfig | ||
from django.conf import settings | ||
from django.dispatch import receiver | ||
from django.utils.translation import gettext_lazy as _ | ||
|
||
from anymail.backends.base import AnymailBaseBackend | ||
from anymail.message import AnymailMessage | ||
from anymail.signals import pre_send | ||
|
||
|
||
class ChatConfig(AppConfig): | ||
name = "chat" | ||
verbose_name = _("Communicator") | ||
|
||
|
||
@receiver(pre_send) | ||
def enrich_envelope(sender: type[AnymailBaseBackend], message: AnymailMessage, **kwargs): | ||
if getattr(message, 'mass_mail', False): | ||
# Mass emails must be sent via the broadcast stream. | ||
return | ||
if message.subject.startswith('[[CHAT]]'): | ||
extra = getattr(message, 'esp_extra', {}) | ||
extra['MessageStream'] = 'notifications-to-users' | ||
message.esp_extra = extra | ||
message.tags = ['notification:chat'] | ||
message.track_opens = True | ||
message.metadata = {'env': settings.ENVIRONMENT} | ||
message.subject = message.subject.removeprefix('[[CHAT]]').strip() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
{% load i18n %}{% autoescape off %} | ||
|
||
{% if RICH_ENVELOPE %}[[ACCOUNT-EMAIL]]{% endif %} | ||
|
||
{{ subject_prefix }}{% trans "Change of email address" context "Email subject" %} | ||
|
||
{% endautoescape %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
{% load i18n %}{% autoescape off %} | ||
|
||
{% if RICH_ENVELOPE %}[[ACCOUNT-EMAIL]]{% endif %} | ||
|
||
{{ subject_prefix }}{% trans "Change of email address" context "Email subject" %} | ||
|
||
{% endautoescape %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
{% load i18n %}{% autoescape off %} | ||
|
||
{% if RICH_ENVELOPE %}[[ACCOUNT]]{% endif %} | ||
|
||
{{ subject_prefix }}{% trans "Password reset" context "Email subject" %} | ||
|
||
{% endautoescape %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
<div class="row well base-form"> | ||
<h5 class="col-xs-3"> | ||
<strong data-toggle="tooltip" title="saluton@pasportaservo.org">Pasporta Servo</strong> | ||
<strong data-toggle="tooltip" title="{{ mailing_address|default:"saluton@pasportaservo.org" }}">Pasporta Servo</strong> | ||
</h5> | ||
<h5 class="col-xs-9 text-left"> | ||
<span id="preview_subject"></span> | ||
<small>- <span id="preview_preheader"></span></small> | ||
<small>– <span id="preview_preheader"></span></small> | ||
</h5> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
{% load i18n %}{% autoescape off %} | ||
|
||
{% if RICH_ENVELOPE %}[[ACCOUNT-EMAIL]]{% endif %} | ||
|
||
{{ subject_prefix }}{% trans "Is this your email address?" context "Email subject" %} | ||
|
||
{% endautoescape %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
{% load i18n %}{% autoescape off %} | ||
|
||
{% if RICH_ENVELOPE %}[[ACCOUNT]]{% endif %} | ||
|
||
{{ subject_prefix }}{% trans "Username reminder" context "Email subject" %} | ||
|
||
{% endautoescape %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
{% load i18n %}{% autoescape off %} | ||
|
||
{% if RICH_ENVELOPE %}[[PLACE-DETAILS]]{% endif %} | ||
|
||
{{ subject_prefix }}{% trans "You received an Authorization" context "Email subject" %} | ||
|
||
{% endautoescape %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.