Commit 71268907 authored by Nicolas Wavrant's avatar Nicolas Wavrant

erp5_base: do not send messages through MailHost if Entity_sendEmail didn't finish without conflict

Also, do not try to reprocess the activity if something goes wrong,
as it may spam the user.
parent bb4a3312
......@@ -33,4 +33,9 @@ create_post_message_method = event.getTypeBasedMethod('createPostMessage')
if create_post_message_method:
create_post_message_method(mail_message)
else:
event.sendMailHostMessage(mail_message)
# We do not want to retry those activities, as sending email is not transactional safe
event.activate(
activity='SQLQueue',
conflict_retry=False,
max_retry=0
).sendMailHostMessage(mail_message)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment