added helscout link for emails

This commit is contained in:
clemkeirua 2020-10-12 14:50:26 +02:00
parent f298d2c2ba
commit 2d492226e3

View file

@ -26,6 +26,8 @@ class WebhookController < ActionController::Base
html << link_to_manager(administrateur, url)
end
html << email_link_to_manager(user)
render json: { html: html.join('<br>') }
end
end
@ -36,6 +38,11 @@ class WebhookController < ActionController::Base
"<a target='_blank' href='#{url}' rel='noopener'>#{model.model_name.human}##{model.id}</a>"
end
def email_link_to_manager(user)
url = emails_manager_user_url(user)
"<a target='_blank' href='#{url}' rel='noopener'>Emails##{user.id}</a>"
end
def verify_signature!
if generate_body_signature(request.body.read) != request.headers['X-Helpscout-Signature']
request_http_token_authentication