mirror of
https://github.com/itflow-org/itflow
synced 2026-12-02 09:09:01 +00:00
Autopay offered to clients: database 4.3.7 adds settings.config_invoice_offer_autopay and recurring_invoices.recurring_invoice_offer_autopay, an invoice from a recurring invoice with no autopay offers Set up autopay in its email and on its guest and portal pages, guest/guest_autopay.php sets it up with no sign-in through a Stripe Checkout Session in setup mode (name, email and agreement kept in its metadata and the recurring invoice's history), the card is saved and autopay turned on when Stripe sends them back, agents are told and the client gets a confirmation, the portal turns it on with a saved card, Settings > Invoices and each recurring invoice's Autopay card can turn the offer off; 26.12.3 changelog
This commit is contained in:
@@ -43,6 +43,8 @@ const EMAIL_REPLY_MARKER = '##- Please type your reply above this line -##';
|
||||
* callout a paragraph that stands out, in the tone's colour
|
||||
* button ['label' => ..., 'url' => ..., 'show_url' => true to print the address under it,
|
||||
* for a link that has to be copied whole]
|
||||
* offer something more they can do, in a box of its own after the button - ['title', 'text',
|
||||
* 'button' => ['label', 'url'], 'small' => a line under its button] (autopay, say)
|
||||
* after paragraphs after the button, smaller
|
||||
* history earlier messages, under a rule at the end - ['label' => the heading, 'items' => [...]],
|
||||
* each item ['by', 'org', 'action', 'when', 'text' => plain text, 'client' => true for
|
||||
@@ -146,6 +148,19 @@ function emailHtml(array $email) {
|
||||
$body .= '<p style="margin:-10px 0 18px;font-size:12px;line-height:1.5;color:' . $muted . ';word-break:break-all;">Or copy this into your browser: ' . $e($email['button']['url']) . '</p>';
|
||||
}
|
||||
}
|
||||
if (!empty($email['offer']['button']['url'])) {
|
||||
$offer = $email['offer'];
|
||||
$primary = $tones['primary'];
|
||||
$body .= '<table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="margin:0 0 22px;background:#f5f9ff;border:1px solid #cfe2ff;border-radius:8px;"><tr>'
|
||||
. '<td style="padding:16px 18px;' . $font . '">'
|
||||
. (trim((string) ($offer['title'] ?? '')) !== '' ? '<div style="margin:0 0 6px;font-size:15px;font-weight:700;color:' . $text . ';">' . $e($offer['title']) . '</div>' : '')
|
||||
. (trim((string) ($offer['text'] ?? '')) !== '' ? '<p style="margin:0 0 14px;font-size:14px;line-height:1.55;color:' . $text . ';">' . nl2br($e($offer['text'])) . '</p>' : '')
|
||||
. '<table role="presentation" cellpadding="0" cellspacing="0"><tr><td bgcolor="#ffffff" style="border:1px solid ' . $primary . ';border-radius:6px;">'
|
||||
. '<a href="' . $e($offer['button']['url']) . '" style="display:inline-block;padding:9px 20px;font-size:14px;font-weight:600;color:' . $primary . ';text-decoration:none;border-radius:6px;' . $font . '">' . $e($offer['button']['label']) . '</a>'
|
||||
. '</td></tr></table>'
|
||||
. (trim((string) ($offer['small'] ?? '')) !== '' ? '<p style="margin:10px 0 0;font-size:12px;line-height:1.5;color:' . $muted . ';">' . nl2br($e($offer['small'])) . '</p>' : '')
|
||||
. '</td></tr></table>';
|
||||
}
|
||||
foreach ((array) ($email['after'] ?? []) as $text_value) {
|
||||
$body .= '<p style="margin:0 0 12px;font-size:13px;line-height:1.55;color:' . $muted . ';">' . nl2br($e($text_value)) . '</p>';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user