Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
3 ตอบกลับ
4870 มุมมอง

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!

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

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.

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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

อวตาร
ละทิ้ง

Exactly something where regex is made for. +1.

Related Posts ตอบกลับ มุมมอง กิจกรรม
2
ม.ค. 24
4409
Problem with email template (SOLVED) แก้ไขแล้ว
2
ม.ค. 24
10124
1
มี.ค. 21
9626
0
ม.ค. 19
7191
1
มี.ค. 15
6994