mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2026-11-21 10:50:37 -05:00
Leave other plugins' features to hooks
Refund emails and PDFs take the shop name and mail settings from :qbo_mail_settings instead of reading redmine_qbo_reminders' settings; the customer page's ticked boxes use generic data-ticked-field/data-ticked-params instead of knowing redmine_qbo_calendar's Add appointment link; and Create issues carries the params plugins name in :qbo_billing_issue_carry_params instead of appointment_id. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
0552e2f1a3
commit
ae0ffc7c1c
10 files changed
+69
-39
No files matched your search
@@ -21,16 +21,16 @@ class QboRefundMailer < ActionMailer::Base
|
||||
def refund_summary(refund, email)
|
||||
@refund = refund
|
||||
@customer = refund.customer
|
||||
reminders = defined?(RedmineQboReminders::Settings) ? RedmineQboReminders::Settings.current : nil
|
||||
@shop_name = reminders&.[]('shop_name').to_s.presence || Setting.app_title
|
||||
delivery = reminders ? reminders.delivery_options : {}
|
||||
settings = RedmineQboBilling.mail_settings
|
||||
@shop_name = settings[:shop_name].presence || Setting.app_title
|
||||
delivery = settings[:delivery] || {}
|
||||
if delivery.empty? && !ActionMailer::Base.perform_deliveries
|
||||
raise DeliveryOff, I18n.t(:text_refund_email_off)
|
||||
end
|
||||
|
||||
options = { to: email, from: reminders&.from.presence || Setting.mail_from.to_s,
|
||||
options = { to: email, from: settings[:from].presence || Setting.mail_from.to_s,
|
||||
subject: I18n.t(:text_refund_email_subject, shop: @shop_name, amount: RedmineQboBilling::RefundWriter.money(refund.refund_amount)) }
|
||||
options[:reply_to] = reminders.reply_to if reminders&.reply_to
|
||||
options[:reply_to] = settings[:reply_to] if settings[:reply_to]
|
||||
message = mail(options.merge(delivery)) do |format|
|
||||
format.text
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user