| @@ -45,9 +45,9 @@ | ||
| 45 | 45 | $vars['intro_paragraph'] = __('Thank you for registering. Click the button below to verify your email and activate your account.', 'yatra'); |
| 46 | 46 | $vars['footer_note'] = __('If you did not create an account, you can ignore this email.', 'yatra'); |
| 47 | 47 | $vars['expiry_notice_html'] = esc_html( |
| 48 | 48 | sprintf( |
| 49 | - /* translators: %d: hours */ | |
| 49 | + /* translators: %d: hours until link expiry */ | |
| 50 | 50 | __('This verification link expires in %d hours for your security.', 'yatra'), |
| 51 | 51 | 24 |
| 52 | 52 | ) |
| 53 | 53 | ); |
| @@ -52,8 +52,21 @@ | ||
| 52 | 52 | ) |
| 53 | 53 | ); |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | + if ($templateKey === 'account_email_change_request') { | |
| 57 | + $vars['new_email'] = '[email protected]'; | |
| 58 | + $vars['verification_link'] = home_url('/?yatra_email_token=preview-change-token'); | |
| 59 | + $vars['intro_paragraph'] = __('You recently requested to change the email address on your account. To confirm this new address, click the button below.', 'yatra'); | |
| 60 | + $vars['footer_note'] = __('If you did not request this change, you can safely ignore this email — your address will not change.', 'yatra'); | |
| 61 | + } | |
| 62 | + | |
| 63 | + if ($templateKey === 'account_email_changed') { | |
| 64 | + $vars['new_email'] = '[email protected]'; | |
| 65 | + $vars['intro_paragraph'] = __('The email address on your account was just changed. If this was you, no further action is needed.', 'yatra'); | |
| 66 | + $vars['footer_note'] = __('If you did not make this change, please contact us immediately.', 'yatra'); | |
| 67 | + } | |
| 68 | + | |
| 56 | 69 | /** @var array<string, string> $filtered */ |
| 57 | 70 | $filtered = apply_filters('yatra_email_template_preview_variables', $vars, $templateKey, $tripId); |
| 58 | 71 | |
| 59 | 72 | return TransactionalEmailTemplateService::mergeTemplateVariables($filtered); |
| @@ -72,8 +85,9 @@ | ||
| 72 | 85 | 'customer_name' => __('Alex Traveler', 'yatra'), |
| 73 | 86 | 'customer_first_name' => 'Alex', |
| 74 | 87 | 'customer_last_name' => __('Traveler', 'yatra'), |
| 75 | 88 | 'customer_email' => '[email protected]', |
| 89 | + 'new_email' => '[email protected]', | |
| 76 | 90 | 'customer_phone' => '+1 555 0100', |
| 77 | 91 | 'booking_reference' => 'YTR-PREVIEW-001', |
| 78 | 92 | 'booking_id' => '42', |
| 79 | 93 | 'trip_id' => '101', |
| @@ -81,8 +95,17 @@ | ||
| 81 | 95 | 'travel_date' => $travelSample, |
| 82 | 96 | 'travelers_count' => '2', |
| 83 | 97 | 'total_amount_formatted' => yatra_format_price(2499.0, $currency), |
| 84 | 98 | 'amount_due_formatted' => yatra_format_price(499.0, $currency), |
| 99 | + // Aliases for the same monetary values — keep the preview | |
| 100 | + // consistent regardless of which spelling the template | |
| 101 | + // uses ({{total_amount}} vs {{total_amount_formatted}}, | |
| 102 | + // {{balance_due}} vs {{amount_due_formatted}}, etc.). | |
| 103 | + 'total_amount' => yatra_format_price(2499.0, $currency), | |
| 104 | + 'balance_due' => yatra_format_price(499.0, $currency), | |
| 105 | + 'amount_due' => yatra_format_price(499.0, $currency), | |
| 106 | + 'amount_paid' => yatra_format_price(2000.0, $currency), | |
| 107 | + 'amount_paid_formatted' => yatra_format_price(2000.0, $currency), | |
| 85 | 108 | 'currency' => $currency, |
| 86 | 109 | 'booking_status' => __('confirmed', 'yatra'), |
| 87 | 110 | 'payment_status' => __('pending', 'yatra'), |
| 88 | 111 | 'intro_paragraph' => __('Thank you for your booking. This preview uses sample data.', 'yatra'), |