 
           # Build links for message sending
           title = formatTitleWithTemplate(panel.title, template_map)
-          imageUrl = "#{endpoint.host}/render/#{apiEndpoint}/db/#{slug}/?panelId=#{panel.id}&width=#{query.width}&height=#{query.height}&from=#{timespan.from}&to=#{timespan.to}#{variables}"
+          db = if query.useUid then dashboard.dashboard.uid else "db"
+          imageUrl = "#{endpoint.host}/render/#{query.apiEndpoint}/#{db}/#{slug}/?panelId=#{panel.id}&width=#{query.width}&height=#{query.height}&from=#{timespan.from}&to=#{timespan.to}#{variables}"
           if query.tz
             imageUrl += "&tz=#{encodeURIComponent query.tz}"
+          if query.orgId
+            imageUrl += "&orgId=#{encodeURIComponent query.orgId}"
           link = "#{endpoint.host}/dashboard/db/#{slug}/?panelId=#{panel.id}&fullscreen&from=#{timespan.from}&to=#{timespan.to}#{variables}"
 
           sendDashboardChart msg, title, imageUrl, link

      'slack'
    else if (robot.adapterName == 'rocketchat')
      'rocketchat'
    else
      ''
  isUploadSupported = site() != ''

        return sendError dashboard.message, msg

      # Defaults
      data = dashboard.dashboard

      # Handle refactor done for version 5.0.0+
