Skip to Content
Menu
This question has been flagged
3 Replies
4868 Rodiniai

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!

Portretas
Atmesti
Autorius Best Answer

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.

Portretas
Atmesti
Best Answer

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

Portretas
Atmesti

Exactly something where regex is made for. +1.

Related Posts Replies Rodiniai Veikla
2
saus. 24
4407
2
saus. 24
10121
1
kov. 21
9624
0
saus. 19
7187
1
kov. 15
6991