mirror of
https://github.com/System-End/hackatime.git
synced 2026-04-19 22:15:14 +00:00
17 lines
551 B
Ruby
17 lines
551 B
Ruby
class HeartbeatExportMailer < ApplicationMailer
|
|
def export_ready(user, recipient_email:, blob_signed_id:, filename:)
|
|
blob = ActiveStorage::Blob.find_signed!(blob_signed_id)
|
|
url_options = Rails.application.config.action_mailer.default_url_options || {}
|
|
|
|
@user = user
|
|
@filename = filename
|
|
@download_url = ActiveStorage::Current.set(url_options:) do
|
|
blob.url(expires_in: 7.days, disposition: "attachment")
|
|
end
|
|
|
|
mail(
|
|
to: recipient_email,
|
|
subject: "Your Hackatime heartbeat export is ready"
|
|
)
|
|
end
|
|
end
|