Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-14090

images that are referenced in wikitext are broken in emails

    XMLWordPrintable

Details

    Description

      Relates to JRA-9699 but is not the same. When referencing an image like !myimage.jpg! in wiki markup in description or comment or whatever, this appears as a broken link in the email that is sent.

      Base URL is correctly set in config, and site added to safe senders in outlook. Unlike JRA-9699, I don't see how this could ever work. Whereas all icons and stylesheets have the full URL, the image is rendered as:

      <img src="/secure/attachment/10833/10833_screenshot-1.jpg" align="absmiddle" border="0" />

      There's no base href in the email so this will not work. It does work if one uses the full URL in the wiki text.

      Currently I'm thinking about adding a <base href...> tag in the email/html/includes/header.vm file, hopefully there is a an available velocity variable corresponding to the base URL.

      Workaround for JIRA 5.2.11:

      1. Add the following source code in issuementioned.vm like here:
        #disable_html_escaping()
        <head>
        <base href="${baseurl}">
        </head>
        #parse("templates/email/html/includes/header.vm")
        <tr valign="top">
            <td id="email-banner" style="padding:32px 32px 0 32px;">
        
                #set ($authorLink = "#authorlink2($remoteUser.name $linkstyle)")
                #set ($issueType = $issue.getIssueTypeObject())
                #set ($issueLink = "#renderIcon(${issueType.iconUrlHtml} ${issueType.getNameTranslation($i18n)}) <a style='color:${textLinkColour};text-decoration:none;' href='${baseurl}/browse/${issue.getKey()}'>$issue.getKey()</a>")
        
                #emailbanner($remoteUser "jira.mentions.email.header" $authorLink $issueLink '')
        
            </td>
        </tr>
        #if ($comment)
        <tr valign="top">
            <td id="email-fields" style="padding:0 32px 32px 32px;">
                <table border="0" cellpadding="0" cellspacing="0" style="padding:0;text-align:left;width:100%;" width="100%">
                    <tr valign="top">
                        <td id="email-gutter" style="width:64px;white-space:nowrap;"></td>
                        <td>
                            <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                #parse("templates/email/html/includes/fields/comment.vm")
                                #parse("templates/email/html/includes/mention-actions.vm")
                            </table>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        #end
        #parse("templates/email/html/includes/footer.vm")
        
      2. Restart JIRA.
        To find the Email Velocity files, please read Customizing Email Content article.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              2e9235c6cdbf Jamie Echlin
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: