diff --git a/app/views/layouts/notify.html.haml b/app/views/layouts/notify.html.haml
index 3e8dae0b230..991d4f0c6d8 100644
--- a/app/views/layouts/notify.html.haml
+++ b/app/views/layouts/notify.html.haml
@@ -21,6 +21,6 @@
\—
%br
- if @project
- You're receiving this notification because you are a member of the #{link_to @project.name_with_namespace, project_url(@project)} project team.
+ You're receiving this notification because you are a member of the #{link_to_unless @target_url, @project.name_with_namespace, project_url(@project)} project team.
- if @target_url
#{link_to "View it on GitLab", @target_url}