Signature: Cursor-Position

Hi
Please add a placeholder for cursor-position in signatures (something like %cursor% , or #{cursor} ) - so we can use the signature-template also as an email-response-template.

Example signature template:

##################
Dear #{ticket.created_by.firstname}

%cursor%

Best regards
#{user.firstname}
Admin & Support


The company
##################

In addition the “<br><br>” on top of the signature should be removed.

Thank you

1 Like

Sorry but in my opinion a mail response template and a signature should at any time be something very different.

You’re use case is to “abuse” a signature which is, as already said, a signature.

I believe that you would rather prefer to choose between a signature and a template of some kind.
Maybe the text modules may help you in speeding up answering.

Just rename this feature from “Signature” to “Mailtemplate” - then your concerns about abusing an important function is gone. :slight_smile:
Why we have to insert the same text-module (=mostly the same greeting) manually on every single answer when we could use a nearly perfect and existing mail template function for this? Its not a big deal to implement a cursor-placeholder. Your users can decide to use it or not. For us it would defintely be an enrichment of an existing feature.

Thank you very much for your feedback. It helps to understand your use case.

Made the coffeesript-methods for this feature:

Function call - place it after signature body-replace (Line 304 in email_reply.coffee )

@findCursorMarker(ui.el.find('.articleNewEdit-body')[0],'%cursor%')

Functions

  @findCursorMarker: (editorElement,marker) ->
    range = @findPos(editorElement,marker)
    if range
      selection = window.getSelection()
      range.collapse false
      selection.removeAllRanges()
      selection.addRange range
    return


  @findPos: (node, marker, range, found) ->
    if !range
      range = document.createRange()
      range.selectNode node
      range.setStart node, 0
    if node.nodeType == Node.TEXT_NODE
      sP = node.textContent.search(marker)
      if sP >= 0
        node.textContent = node.textContent.replace marker, "\r\n"
        range.setEnd node, sP
        found = true
    else
      lp = 0
      while lp < node.childNodes.length
        range = @findPos(node.childNodes[lp], marker, range, found)
        if found
          break
        lp++
    range
1 Like

This topic was automatically closed after 416 days. New replies are no longer allowed.