diff --git a/app/assets/javascripts/app/controllers/agent_ticket_create/form_hander_signature.coffee b/app/assets/javascripts/app/controllers/agent_ticket_create/form_handler_signature.coffee
similarity index 77%
rename from app/assets/javascripts/app/controllers/agent_ticket_create/form_hander_signature.coffee
rename to app/assets/javascripts/app/controllers/agent_ticket_create/form_handler_signature.coffee
index b8a35e050..3bf7d56cc 100644
--- a/app/assets/javascripts/app/controllers/agent_ticket_create/form_hander_signature.coffee
+++ b/app/assets/javascripts/app/controllers/agent_ticket_create/form_handler_signature.coffee
@@ -1,4 +1,4 @@
-class TicketCreateFormHanderSignature
+class TicketCreateFormHandlerSignature
@run: (params, attribute, attributes, classname, form, ui) ->
return if !attribute
@@ -19,10 +19,7 @@ class TicketCreateFormHanderSignature
if App.Utils.signatureCheck(currentBody.html() || '', signatureFinished)
# if signature has changed, in case remove old signature
- signature_id = ui.el.closest('.content').find('[data-signature=true]').data('signature-id')
- if signature_id && signature_id.toString() isnt signature.id.toString()
-
- ui.el.closest('.content').find('[data-signature="true"]').remove()
+ ui.el.closest('.content').find('[data-signature="true"]').remove()
if !App.Utils.htmlLastLineEmpty(currentBody)
currentBody.append('
')
@@ -35,4 +32,4 @@ class TicketCreateFormHanderSignature
else
ui.el.closest('.content').find('[data-name="body"]').find('[data-signature=true]').remove()
-App.Config.set('200-ticketFormSignature', TicketCreateFormHanderSignature, 'TicketCreateFormHandler')
+App.Config.set('200-ticketFormSignature', TicketCreateFormHandlerSignature, 'TicketCreateFormHandler')
diff --git a/spec/system/ticket/create_spec.rb b/spec/system/ticket/create_spec.rb
index 7a7701517..ef7c7d27d 100644
--- a/spec/system/ticket/create_spec.rb
+++ b/spec/system/ticket/create_spec.rb
@@ -878,4 +878,32 @@ RSpec.describe 'Ticket Create', type: :system do
expect(page.find('.richtext-content')).to have_text('Support')
end
end
+
+ describe 'Zammad 5 mail template double signature #3816', authenticated_as: :authenticate do
+ let(:agent_template) { create(:agent) }
+ let!(:template) do
+ create(
+ :template,
+ :dummy_data,
+ group: Group.first, owner: agent_template,
+ body: 'Content dummy.