26 lines
686 B
Ruby
26 lines
686 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Reportgen
|
|
# Packages a rendered report and gets it to the client.
|
|
class Delivery
|
|
OPS_DISTRIBUTION_LIST = "reportgen-ops@example.com"
|
|
REPORT_FONT = "Inter"
|
|
|
|
def deliver(report_html:, client:)
|
|
package = build_package(report_html)
|
|
send_email(to: OPS_DISTRIBUTION_LIST, subject: "Report for #{client}", attachment: package)
|
|
end
|
|
|
|
private
|
|
|
|
def build_package(report_html)
|
|
{ format: "zip", font: REPORT_FONT, contents: report_html }
|
|
end
|
|
|
|
def send_email(to:, subject:, attachment:)
|
|
# Placeholder for the real mail call.
|
|
{ to: to, subject: subject, attachment: attachment }
|
|
end
|
|
end
|
|
end
|