-
Notifications
You must be signed in to change notification settings - Fork 262
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Send an email when the project is created via the API.
- Loading branch information
Showing
7 changed files
with
39 additions
and
21 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from flask_babel import gettext as _ | ||
from flask_mail import Message | ||
from flask import g | ||
|
||
from ihatemoney.utils import render_localized_template, send_email | ||
|
||
|
||
def send_creation_email(project): | ||
g.project = project | ||
message_title = _( | ||
"You have just created '%(project)s' " "to share your expenses", | ||
project=project.name, | ||
) | ||
|
||
message_body = render_localized_template("reminder_mail", project=project) | ||
|
||
msg = Message(message_title, body=message_body, recipients=[project.contact_email]) | ||
return send_email(msg) |
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 @@ | ||
Hi, | ||
|
||
You have just (or someone else using your email address) created the project "{{ g.project.name }}" to share your expenses. | ||
You have just (or someone else using your email address) created the project "{{ project.name }}" to share your expenses. | ||
|
||
You can access it here: {{ url_for(".list_bills", _external=True) }} (the identifier is {{ g.project.id }}). | ||
You can access it here: {{ url_for("main.list_bills", _external=True) }} (the identifier is {{ project.id }}). | ||
If you want to share this project with your friends, you can share the identifier and the shared password with them or send them invitations with the following link: | ||
{{ url_for(".invite", _external=True) }} | ||
{{ url_for("main.invite", _external=True) }} | ||
|
||
Enjoy, |
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 @@ | ||
Salut, | ||
|
||
Vous venez de créer le projet "{{ g.project.name }}" pour partager vos dépenses. | ||
Vous venez de créer le projet "{{ project.name }}" pour partager vos dépenses. | ||
|
||
Vous pouvez y accéder ici : {{ url_for(".list_bills", _external=True) }} (l'identifiant est {{ g.project.id }}). | ||
Vous pouvez y accéder ici : {{ url_for("main.list_bills", _external=True) }} (l'identifiant est {{ project.id }}). | ||
Si vous voulez partager ce projet avec vos amis, vous pouvez soit leur transmettre l'identifiant et le code d'accès, soit leur envoyer une invitation personnelle grâce au lien suivant : | ||
{{ url_for(".invite", _external=True) }} | ||
{{ url_for("main.invite", _external=True) }} | ||
|
||
Faites-en bon usage ! |
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