Class: NotifyPreview

Inherits:
ActionMailer::Preview
  • Object
show all
Defined in:
app/mailers/previews/notify_preview.rb

Instance Method Summary collapse

Instance Method Details

#autodevops_disabled_emailObject


172
173
174
# File 'app/mailers/previews/notify_preview.rb', line 172

def autodevops_disabled_email
  Notify.autodevops_disabled_email(pipeline, user.email).message
end

#changed_milestone_issue_emailObject


79
80
81
# File 'app/mailers/previews/notify_preview.rb', line 79

def changed_milestone_issue_email
  Notify.changed_milestone_issue_email(user.id, issue.id, milestone, user.id)
end

#changed_milestone_merge_request_emailObject


119
120
121
# File 'app/mailers/previews/notify_preview.rb', line 119

def changed_milestone_merge_request_email
  Notify.changed_milestone_merge_request_email(user.id, merge_request.id, milestone, user.id)
end

#closed_issue_emailObject


67
68
69
# File 'app/mailers/previews/notify_preview.rb', line 67

def closed_issue_email
  Notify.closed_issue_email(user.id, issue.id, user.id).message
end

#closed_merge_request_emailObject


99
100
101
# File 'app/mailers/previews/notify_preview.rb', line 99

def closed_merge_request_email
  Notify.closed_merge_request_email(user.id, issue.id, user.id).message
end

#import_issues_csv_emailObject


83
84
85
# File 'app/mailers/previews/notify_preview.rb', line 83

def import_issues_csv_email
  Notify.import_issues_csv_email(user.id, project.id, { success: 3, errors: [5, 6, 7], valid_file: true })
end

#issue_status_changed_emailObject


71
72
73
# File 'app/mailers/previews/notify_preview.rb', line 71

def issue_status_changed_email
  Notify.issue_status_changed_email(user.id, issue.id, 'closed', user.id).message
end

#issues_csv_emailObject


87
88
89
# File 'app/mailers/previews/notify_preview.rb', line 87

def issues_csv_email
  Notify.issues_csv_email(user, project, '1997,Ford,E350', { truncated: false, rows_expected: 3, rows_written: 3 }).message
end

#member_access_denied_emailObject


123
124
125
# File 'app/mailers/previews/notify_preview.rb', line 123

def member_access_denied_email
  Notify.member_access_denied_email('project', project.id, user.id).message
end

#member_access_granted_emailObject


127
128
129
# File 'app/mailers/previews/notify_preview.rb', line 127

def member_access_granted_email
  Notify.member_access_granted_email(member.source_type, member.id).message
end

#member_access_requested_emailObject


131
132
133
# File 'app/mailers/previews/notify_preview.rb', line 131

def member_access_requested_email
  Notify.member_access_requested_email(member.source_type, member.id, user.id).message
end

#member_invite_accepted_emailObject


135
136
137
# File 'app/mailers/previews/notify_preview.rb', line 135

def member_invite_accepted_email
  Notify.member_invite_accepted_email(member.source_type, member.id).message
end

#member_invite_declined_emailObject


139
140
141
142
143
144
145
146
# File 'app/mailers/previews/notify_preview.rb', line 139

def member_invite_declined_email
  Notify.member_invite_declined_email(
    'project',
    project.id,
    '[email protected]',
    user.id
  ).message
end

#member_invited_emailObject


148
149
150
# File 'app/mailers/previews/notify_preview.rb', line 148

def member_invited_email
  Notify.member_invited_email('project', member.id, '1234').message
end

#merge_request_status_emailObject


103
104
105
# File 'app/mailers/previews/notify_preview.rb', line 103

def merge_request_status_email
  Notify.merge_request_status_email(user.id, merge_request.id, 'reopened', user.id).message
end

#merge_request_unmergeable_emailObject


107
108
109
# File 'app/mailers/previews/notify_preview.rb', line 107

def merge_request_unmergeable_email
  Notify.merge_request_unmergeable_email(user.id, merge_request.id, 'conflict').message
end

#merge_when_pipeline_succeeds_emailObject


200
201
202
# File 'app/mailers/previews/notify_preview.rb', line 200

def merge_when_pipeline_succeeds_email
  Notify.merge_when_pipeline_succeeds_email(user.id, merge_request.id, user.id).message
end

#merged_merge_request_emailObject


111
112
113
# File 'app/mailers/previews/notify_preview.rb', line 111

def merged_merge_request_email
  Notify.merged_merge_request_email(user.id, merge_request.id, user.id).message
end

#new_email_address_added_emailObject


184
185
186
# File 'app/mailers/previews/notify_preview.rb', line 184

def new_email_address_added_email
  Notify.new_email_address_added_email(user, '[email protected]').message
end

#new_issue_emailObject


91
92
93
# File 'app/mailers/previews/notify_preview.rb', line 91

def new_issue_email
  Notify.new_issue_email(user.id, issue.id).message
end

#new_mention_in_merge_request_emailObject


63
64
65
# File 'app/mailers/previews/notify_preview.rb', line 63

def new_mention_in_merge_request_email
  Notify.new_mention_in_merge_request_email(user.id, issue.id, user.id).message
end

#new_merge_request_emailObject


95
96
97
# File 'app/mailers/previews/notify_preview.rb', line 95

def new_merge_request_email
  Notify.new_merge_request_email(user.id, merge_request.id).message
end

#note_merge_request_email_for_diff_discussionObject


37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'app/mailers/previews/notify_preview.rb', line 37

def note_merge_request_email_for_diff_discussion
  note_email(:note_merge_request_email) do
    note = <<-MD.strip_heredoc
      This is a new discussion on a merge request :smiley:

      In this notification email, we expect to see:

      - A line saying who started this discussion and on what file
      - The diff
      - The note contents (that's what you're looking at)
      - A link to view this discussion on GitLab
      - An explanation for why the user is receiving this notification
    MD

    position = Gitlab::Diff::Position.new(
      old_path: "files/ruby/popen.rb",
      new_path: "files/ruby/popen.rb",
      old_line: nil,
      new_line: 14,
      diff_refs: merge_request.diff_refs
    )

    create_note(noteable_type: 'merge_request', noteable_id: merge_request.id, type: 'DiffNote', position: position, note: note)
  end
end

#note_merge_request_email_for_discussionObject


20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'app/mailers/previews/notify_preview.rb', line 20

def note_merge_request_email_for_discussion
  note_email(:note_merge_request_email) do
    note = <<-MD.strip_heredoc
      This is a new discussion on a merge request :smiley:

      In this notification email, we expect to see:

      - A line saying who started this discussion
      - The note contents (that's what you're looking at)
      - A link to view this discussion on GitLab
      - An explanation for why the user is receiving this notification
    MD

    create_note(noteable_type: 'merge_request', noteable_id: merge_request.id, type: 'DiscussionNote', note: note)
  end
end

#note_merge_request_email_for_individual_noteObject


4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'app/mailers/previews/notify_preview.rb', line 4

def note_merge_request_email_for_individual_note
  note_email(:note_merge_request_email) do
    note = <<-MD.strip_heredoc
      This is an individual note on a merge request :smiley:

      In this notification email, we expect to see:

      - The note contents (that's what you're looking at)
      - A link to view this note on GitLab
      - An explanation for why the user is receiving this notification
    MD

    create_note(noteable_type: 'merge_request', noteable_id: merge_request.id, note: note)
  end
end

#pages_domain_enabled_emailObject


152
153
154
155
156
157
158
# File 'app/mailers/previews/notify_preview.rb', line 152

def pages_domain_enabled_email
  cleanup do
    pages_domain = PagesDomain.new(domain: 'my.example.com', project: project, verified_at: Time.now, enabled_until: 1.week.from_now)

    Notify.pages_domain_enabled_email(pages_domain, user).message
  end
end

#pipeline_failed_emailObject


164
165
166
# File 'app/mailers/previews/notify_preview.rb', line 164

def pipeline_failed_email
  Notify.pipeline_failed_email(pipeline, pipeline.user.try(:email))
end

#pipeline_fixed_emailObject


168
169
170
# File 'app/mailers/previews/notify_preview.rb', line 168

def pipeline_fixed_email
  Notify.pipeline_fixed_email(pipeline, pipeline.user.try(:email))
end

#pipeline_success_emailObject


160
161
162
# File 'app/mailers/previews/notify_preview.rb', line 160

def pipeline_success_email
  Notify.pipeline_success_email(pipeline, pipeline.user.try(:email))
end

#remote_mirror_update_failed_emailObject


176
177
178
# File 'app/mailers/previews/notify_preview.rb', line 176

def remote_mirror_update_failed_email
  Notify.remote_mirror_update_failed_email(remote_mirror.id, user.id).message
end

#removed_milestone_issue_emailObject


75
76
77
# File 'app/mailers/previews/notify_preview.rb', line 75

def removed_milestone_issue_email
  Notify.removed_milestone_issue_email(user.id, issue.id, user.id)
end

#removed_milestone_merge_request_emailObject


115
116
117
# File 'app/mailers/previews/notify_preview.rb', line 115

def removed_milestone_merge_request_email
  Notify.removed_milestone_merge_request_email(user.id, merge_request.id, user.id)
end

#service_desk_new_note_emailObject


188
189
190
191
192
193
194
# File 'app/mailers/previews/notify_preview.rb', line 188

def service_desk_new_note_email
  cleanup do
    note = create_note(noteable_type: 'Issue', noteable_id: issue.id, note: 'Issue note content')

    Notify.service_desk_new_note_email(issue.id, note.id, '[email protected]').message
  end
end

#service_desk_thank_you_emailObject


196
197
198
# File 'app/mailers/previews/notify_preview.rb', line 196

def service_desk_thank_you_email
  Notify.service_desk_thank_you_email(issue.id).message
end

#unknown_sign_in_emailObject


180
181
182
# File 'app/mailers/previews/notify_preview.rb', line 180

def 
  Notify.(user, '127.0.0.1', Time.current).message
end