-
-
Notifications
You must be signed in to change notification settings - Fork 626
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[17.0][IMP] mail_notification_custom_subject: Do not replace the subject if it is already defined + add inside replace option #1548
base: 17.0
Are you sure you want to change the base?
Conversation
Hi @yajo, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see the subject_to_replace
feature very limited, as you can only do one replacement. But I think it's not needed as well, as you can do a whole replacement and use expressions to paint that. And anyway, for the particular case we need it, we should use a stored value in the mail template (object.partner_id.comercial or object.name
if I'm not wrong).
It is important to clarify that you can set several inside template records to make several replacements if necessary. I will change the behavior of the |
809d101
to
9469da8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution! Could you please add an entry about this in the docs?
mail_notification_custom_subject/models/mail_message_custom_subject.py
Outdated
Show resolved
Hide resolved
mail_notification_custom_subject/models/mail_message_custom_subject.py
Outdated
Show resolved
Hide resolved
mail_notification_custom_subject/models/mail_message_custom_subject.py
Outdated
Show resolved
Hide resolved
9469da8
to
7594aa1
Compare
… it is already set If we write something from the mail thread (without subject) it is only when it should replace the subject. TT52259
…ing the subject If there is an error in the template we want to render the subject to be shown and acted upon. Related to OCA#1548 (comment) TT52259
7594aa1
to
eb7d3ac
Compare
…ception to know what has happened TT52259
Example use Case: Our company is called: MY_COMPANY_NAME but is known as MCN, we want to replace in some places the subject line so that it is sent with MCN TT52259
eb7d3ac
to
adb7204
Compare
rendered_subject_to_replace, | ||
rendered_subject_template, | ||
) | ||
except Exception: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need a double except
catch? I think the general one serves enough.
Changes done:
Please @pedrobaeza and @sergio-teruel can you review it?
@Tecnativa TT52259