Footer: why the customer got the reminder and how to stop

A new Footer setting, shown under the message (after a rule, small and grey in
the HTML version): "You're getting this email because you have an appointment
with us. Rather not get reminders? Just reply and let us know." Settings saved
before it existed get the default; blank turns it off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BiwYMjhoQvL7XsKKfRz4pM
This commit is contained in:
Claude committed 2026-11-01 07:23:33 -05:00
1 parent e363602bea
commit 1c955c7923
6 files changed
+36 -9

No files matched your search

+2 -2
View File
@@ -4,7 +4,7 @@ Emails customers a reminder before their appointments in [redmine_qbo_calendar](
* **When**: a set number of days before the appointment at a set time (default: the day before at 4 PM), only between set hours (default 8 AM–8 PM), and not within a set number of hours of the appointment (default 2). An appointment booked after its reminder time gets one right away. Rescheduling an appointment sends a reminder for the new time. * **When**: a set number of days before the appointment at a set time (default: the day before at 4 PM), only between set hours (default 8 AM–8 PM), and not within a set number of hours of the appointment (default 2). An appointment booked after its reminder time gets one right away. Rescheduling an appointment sends a reminder for the new time.
* **Which**: appointments with the chosen statuses (default: Scheduled), with a customer who has an email address in QuickBooks and hasn't had reminders turned off. * **Which**: appointments with the chosen statuses (default: Scheduled), with a customer who has an email address in QuickBooks and hasn't had reminders turned off.
* **What**: a short plain-text and HTML email in your words (placeholders for the customer, vehicle, day, time and shop details), with the appointment attached as a calendar file. * **What**: a short plain-text and HTML email in your words (placeholders for the customer, vehicle, day, time and shop details), with the appointment attached as a calendar file. A footer says why they got it and to reply if they'd rather not get reminders.
* **Appointment page**: whether the reminder was sent (when, to whom), when it will be, or why it won't be, with **Send now** / **Send again**. * **Appointment page**: whether the reminder was sent (when, to whom), when it will be, or why it won't be, with **Send now** / **Send again**.
* **Customer page**: turn reminders off (or back on) for a customer. * **Customer page**: turn reminders off (or back on) for a customer.
* **Settings page**: send a test email with the settings as they are on the page, see recent reminders (and why any failed), and send due reminders now. * **Settings page**: send a test email with the settings as they are on the page, see recent reminders (and why any failed), and send due reminders now.
@@ -57,7 +57,7 @@ The password is kept in Redmine's plugin settings (in the database), like other
Check by sending a test (settings page) to a Gmail address and choosing **Show original**: SPF, DKIM and DMARC should all say PASS. Check by sending a test (settings page) to a Gmail address and choosing **Show original**: SPF, DKIM and DMARC should all say PASS.
2. **From address** on your domain, the same mailbox you send through, with your shop's name as the From name. 2. **From address** on your domain, the same mailbox you send through, with your shop's name as the From name.
3. **Keep the message personal and short.** The default asks customers to reply to confirm; replies help your reputation. Avoid link shorteners and image-only mail. 3. **Keep the message personal and short.** The default asks customers to reply to confirm; replies help your reputation. Avoid link shorteners and image-only mail.
4. Reminders are transactional, so they don't need an unsubscribe link; turning reminders off on the customer page covers customers who'd rather not get them. 4. Reminders are transactional, so they don't need an unsubscribe link. The footer still tells customers to reply if they'd rather not get them (so they reply instead of marking the email as spam); when they do, turn reminders off on their customer page. Keep the message free of promotions: that's what keeps it transactional.
5. Optional: [Google Postmaster Tools](https://postmaster.google.com) shows how Gmail sees your domain once you send more. 5. Optional: [Google Postmaster Tools](https://postmaster.google.com) shows how Gmail sees your domain once you send more.
## Running on schedule ## Running on schedule
@@ -127,6 +127,11 @@
<%= l(:text_reminders_sections) %> <%= l(:text_reminders_sections) %>
</em> </em>
</p> </p>
<p>
<label for="reminders_footer"><%= l(:label_reminders_footer) %></label>
<%= text_area_tag field.call('footer'), s['footer'], id: 'reminders_footer', rows: 3, cols: 70, class: 'reminders-body' %>
<em class="info"><%= l(:text_reminders_footer) %></em>
</p>
<p> <p>
<label><%= l(:label_reminders_attach_calendar) %></label> <label><%= l(:label_reminders_attach_calendar) %></label>
<%= hidden_field_tag field.call('attach_calendar'), '0', id: nil %> <%= hidden_field_tag field.call('attach_calendar'), '0', id: nil %>
+2
View File
@@ -76,6 +76,8 @@ en:
label_reminders_body: "Message" label_reminders_body: "Message"
text_reminders_placeholders: "Placeholders:" text_reminders_placeholders: "Placeholders:"
text_reminders_sections: "{{#vehicle}}…{{/vehicle}} shows only when there is a vehicle; {{^vehicle}}…{{/vehicle}} only when there isn't. Sent as plain text and as simple HTML." text_reminders_sections: "{{#vehicle}}…{{/vehicle}} shows only when there is a vehicle; {{^vehicle}}…{{/vehicle}} only when there isn't. Sent as plain text and as simple HTML."
label_reminders_footer: "Footer"
text_reminders_footer: "Shown under the message, set apart in small grey text: why they're getting it and how to stop (turn reminders off on their customer page when they reply). Placeholders work here too; blank for none."
label_reminders_attach_calendar: "Attach calendar file" label_reminders_attach_calendar: "Attach calendar file"
text_reminders_attach_calendar: "An .ics file, so the customer can add the appointment to their calendar." text_reminders_attach_calendar: "An .ics file, so the customer can add the appointment to their calendar."
label_reminders_test: "Send a test to" label_reminders_test: "Send a test to"
+12 -2
View File
@@ -49,12 +49,22 @@ module RedmineQboReminders
Template.render_line(settings['subject'].presence || Template::DEFAULT_SUBJECT, values) Template.render_line(settings['subject'].presence || Template::DEFAULT_SUBJECT, values)
end end
# The message and its footer, as plain text
def text def text
Template.render(settings['body'].presence || Template::DEFAULT_BODY, values) [body, footer].compact.join("\n\n--\n")
end end
def html def html
Template.html(text) Template.html(body, footer)
end
def body
Template.render(settings['body'].presence || Template::DEFAULT_BODY, values)
end
# nil when the footer setting is blank
def footer
Template.render(settings['footer'].to_s, values).presence
end end
# The calendar attachment, or nil when it's turned off # The calendar attachment, or nil when it's turned off
+2 -1
View File
@@ -36,7 +36,8 @@ module RedmineQboReminders
'shop_phone' => '', 'shop_phone' => '',
'shop_address' => '', 'shop_address' => '',
'subject' => Template::DEFAULT_SUBJECT, 'subject' => Template::DEFAULT_SUBJECT,
'body' => Template::DEFAULT_BODY 'body' => Template::DEFAULT_BODY,
'footer' => Template::DEFAULT_FOOTER
}.freeze }.freeze
def self.current def self.current
+13 -4
View File
@@ -33,6 +33,9 @@ module RedmineQboReminders
{{shop_phone}} {{shop_phone}}
TEXT TEXT
# Under the message, set apart (smaller and grey in the HTML version): why they got it and how to stop
DEFAULT_FOOTER = "You're getting this email because you have an appointment with us. Rather not get reminders? Just reply and let us know."
module_function module_function
# The text with placeholders filled in (values: { "vehicle" => "2022 Jeep Gladiator", ... }) # The text with placeholders filled in (values: { "vehicle" => "2022 Jeep Gladiator", ... })
@@ -52,10 +55,16 @@ module RedmineQboReminders
render(text, values).gsub(/\s+/, ' ').strip render(text, values).gsub(/\s+/, ' ').strip
end end
# Plain text as simple HTML: paragraphs at blank lines, line breaks kept # Plain text as simple HTML: paragraphs at blank lines, line breaks kept; the footer after a rule, small
def html(text) # and grey
paragraphs = text.split(/\n{2,}/).map do |para| def html(text, footer = nil)
"<p style=\"margin:0 0 1em\">#{para.split("\n").map { |line| CGI.escapeHTML(line) }.join('<br>')}</p>" para = lambda do |chunk, style|
"<p style=\"#{style}\">#{chunk.split("\n").map { |line| CGI.escapeHTML(line) }.join('<br>')}</p>"
end
paragraphs = text.split(/\n{2,}/).map { |chunk| para.call(chunk, 'margin:0 0 1em') }
if footer.to_s.strip != ''
paragraphs << '<hr style="border:none;border-top:1px solid #ddd;margin:1.5em 0 1em">'
paragraphs += footer.split(/\n{2,}/).map { |chunk| para.call(chunk, 'margin:0 0 0.6em;font-size:12px;color:#777') }
end end
<<~HTML <<~HTML
<!DOCTYPE html> <!DOCTYPE html>