Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
3 Trả lời
4840 Lượt xem

Hi!

I am trying to use the email_from field as receiving address in an email template. These addresses are not in our partner database. Unfortunately most emails come in with special characters like "JohnDoe"<jd@mail.xy>. The characters "<> mess up the mail address created through email_from.

How can I get around this? Thanks for any help!

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

Thank you for your comments about using RegEx, but there is even a much simpler solution: just use the |safe option.

The field sniplet ${object.email_from|safe} works perfectly.

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Maybe you can use regexp to clean up the addresses: https://docs.python.org/2/library/re.html

Ảnh đại diện
Huỷ bỏ

Exactly something where regex is made for. +1.

Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 1 24
4356
2
thg 1 24
10046
1
thg 3 21
9587
0
thg 1 19
7156
1
thg 3 15
6945