diff options
author | Brendan Abolivier <babolivier@matrix.org> | 2022-03-11 16:15:11 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-11 15:15:11 +0000 |
commit | e6a106fd5ebbf30a7c84f8ba09dc903d20213be3 (patch) | |
tree | ef6a140878f1fa7903842f943da01fa2e40fc0a8 /docs/templates.md | |
parent | Improve code documentation for the typing stream over replication. (#12211) (diff) | |
download | synapse-e6a106fd5ebbf30a7c84f8ba09dc903d20213be3.tar.xz |
Implement a Jinja2 filter to extract localparts from email addresses (#12212)
Diffstat (limited to 'docs/templates.md')
-rw-r--r-- | docs/templates.md | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/docs/templates.md b/docs/templates.md index b251d05cb9..f87692a453 100644 --- a/docs/templates.md +++ b/docs/templates.md @@ -36,6 +36,13 @@ Turns a `mxc://` URL for media content into an HTTP(S) one using the homeserver' Example: `message.sender_avatar_url|mxc_to_http(32,32)` +```python +localpart_from_email(address: str) -> str +``` + +Returns the local part of an email address (e.g. `alice` in `alice@example.com`). + +Example: `user.email_address|localpart_from_email` ## Email templates |