fix
This commit is contained in:
parent
4be346cbf1
commit
2d1fc59484
5
main.py
5
main.py
@ -52,7 +52,7 @@ token_chars = string.ascii_lowercase+string.ascii_uppercase+string.digits
|
||||
token_len = 50
|
||||
|
||||
# form template regex
|
||||
form_regex = '\{\{(\w+)(\|[\w\s,\.\?\'\"\!\[\]]+)?\}\}'
|
||||
form_regex = '\{\{(\w+)(\|[\w\s,\.\?\-\'\"\!\[\]]+)?\}\}'
|
||||
|
||||
# Load file from .env file.
|
||||
load_dotenv(os.path.dirname(__file__) + '.env')
|
||||
@ -137,6 +137,9 @@ def submission ():
|
||||
save_mail (token, form['mail'], from_address, subject, content)
|
||||
response.status = 500
|
||||
error = 'Impossible de trouver le destinataire du mail. Votre message a été enregistré, il sera remis manuellement à son destinataire.'
|
||||
except Exception as e:
|
||||
save_mail (token, form['mail'], from_address, subject, content)
|
||||
raise
|
||||
|
||||
|
||||
# Redirection
|
||||
|
@ -33,7 +33,7 @@ You can choose how information sent with form will be displayed in the final mai
|
||||
Here is a template example :
|
||||
```
|
||||
subject: "[Contact] {{nom|anonyme}} — {{object|no object}}"
|
||||
content: "{{message}}"
|
||||
content: "Message de contact :%0D%0A{{message}}"
|
||||
```
|
||||
When the form will be submitted to the mailer, parts like `{{…}}` will be replaced by fields content of the same name!
|
||||
If the field holds no value, two possibilities:
|
||||
|
Loading…
Reference in New Issue
Block a user