Class: DeliveryUncle::EmailRequestsController
Constant Summary
ApplicationController::MAILERS
Instance Method Summary
collapse
Instance Method Details
#block ⇒ Object
57
58
59
60
61
62
|
# File 'app/controllers/delivery_uncle/email_requests_controller.rb', line 57
def block
mailer ?
act_on_mailer(:block_mailer, mailer) :
error_mailer_not_found
redirect_to action: :configure
end
|
#index ⇒ Object
6
7
8
9
10
11
12
|
# File 'app/controllers/delivery_uncle/email_requests_controller.rb', line 6
def index
requests = EmailRequest.order_by_latest
= paginate.page(requests, params)
@requests = .data
@pagination =
end
|
#pause ⇒ Object
18
19
20
21
|
# File 'app/controllers/delivery_uncle/email_requests_controller.rb', line 18
def pause
EmailQueue.pause(email_request) if email_request.present?
redirect_to email_requests_url
end
|
#pause_all ⇒ Object
23
24
25
26
27
28
29
30
31
32
33
|
# File 'app/controllers/delivery_uncle/email_requests_controller.rb', line 23
def pause_all
if email_request.present?
EmailRequest.
not_sent.
with_mailer_method(email_request.mailer, email_request.mailer_method).
each do |entry|
EmailQueue.pause(entry)
end
end
redirect_to email_requests_url
end
|
#retry ⇒ Object
35
36
37
38
|
# File 'app/controllers/delivery_uncle/email_requests_controller.rb', line 35
def retry
EmailQueue.retry(email_request) if email_request.present?
redirect_to email_requests_url
end
|
#retry_all ⇒ Object
40
41
42
43
44
45
46
47
48
49
50
|
# File 'app/controllers/delivery_uncle/email_requests_controller.rb', line 40
def retry_all
if email_request.present?
EmailRequest.
not_sent.
with_mailer_method(email_request.mailer, email_request.mailer_method).
each do |entry|
EmailQueue.retry(entry)
end
end
redirect_to email_requests_url
end
|
#show ⇒ Object
14
15
16
|
# File 'app/controllers/delivery_uncle/email_requests_controller.rb', line 14
def show
@request = email_request
end
|
#unblock ⇒ Object
64
65
66
67
68
69
|
# File 'app/controllers/delivery_uncle/email_requests_controller.rb', line 64
def unblock
mailer ?
act_on_mailer(:unblock_mailer, mailer) :
error_mailer_not_found
redirect_to action: :configure
end
|