diff --git a/framework/entity/BasicEntities.xml b/framework/entity/BasicEntities.xml
index d71b77fc5..811dd5ef8 100644
--- a/framework/entity/BasicEntities.xml
+++ b/framework/entity/BasicEntities.xml
@@ -554,6 +554,8 @@ along with this software (see the LICENSE.md file). If not, see
For outgoing messages that came from an EmailTemplate.
+
+
diff --git a/framework/service/org/moqui/impl/EmailServices.xml b/framework/service/org/moqui/impl/EmailServices.xml
index b08b328d4..b753b5153 100644
--- a/framework/service/org/moqui/impl/EmailServices.xml
+++ b/framework/service/org/moqui/impl/EmailServices.xml
@@ -26,6 +26,7 @@ along with this software (see the LICENSE.md file). If not, see
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/framework/src/main/resources/org/moqui/impl/sendEmailMessage.groovy b/framework/src/main/resources/org/moqui/impl/sendEmailMessage.groovy
index 2e0b1373c..30e58682f 100644
--- a/framework/src/main/resources/org/moqui/impl/sendEmailMessage.groovy
+++ b/framework/src/main/resources/org/moqui/impl/sendEmailMessage.groovy
@@ -149,6 +149,9 @@ try {
} catch (Throwable t) {
logger.error("Error in sendEmailTemplate", t)
ec.message.addMessage("Error sending email: ${t.toString()}")
+ ec.service.sync().name("update", "moqui.basic.email.EmailMessage").requireNewTransaction(true)
+ .parameters([emailMessageId:emailMessageId, lastSendAttemptDate:ec.user.nowTimestamp, sendAttemptCount:((emailMessage.sendAttemptCount?:0)+1)])
+ .disableAuthz().call()
}
return