$device Sanitized device payload (model, brand, os, os_version, app_version). * @var int $consumed_at Unix timestamp of the exchange. * @var string $ap_name Descriptive Application Password name. * @var string $site_name Decoded site name. * @var string $subject Email subject; rendered as the in-body heading. * @var string $applications_url Admin URL to the user's Application Passwords list. */ declare( strict_types=1 ); defined( 'ABSPATH' ) || exit; $device_model = isset( $device['model'] ) ? trim( (string) $device['model'] ) : ''; $device_brand = isset( $device['brand'] ) ? trim( (string) $device['brand'] ) : ''; $device_os = isset( $device['os'] ) ? trim( (string) $device['os'] ) : ''; $device_os_version = isset( $device['os_version'] ) ? trim( (string) $device['os_version'] ) : ''; $app_version = isset( $device['app_version'] ) ? trim( (string) $device['app_version'] ) : ''; // /qr-login-scan requires a device payload, so by the time this email // renders we have at least an OS label. Prefer "{Brand} {Model}" when both // are present; fall back to model alone, then to OS. if ( '' !== $device_brand && '' !== $device_model ) { $display_name = ucfirst( $device_brand ) . ' ' . $device_model; } elseif ( '' !== $device_model ) { $display_name = $device_model; } elseif ( '' !== $device_os ) { $display_name = $device_os; } else { $display_name = __( 'WooCommerce mobile app', 'woocommerce' ); } $os_line = trim( $device_os . ( '' !== $device_os_version ? ' ' . $device_os_version : '' ) ); $timestamp = (string) wp_date( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), $consumed_at ); $preheader = sprintf( /* translators: 1: device name. 2: site name. */ __( '%1$s just signed in to the WooCommerce mobile app for %2$s.', 'woocommerce' ), $display_name, $site_name ); $brand_purple_50 = '#873eff'; $brand_purple_70 = '#5007aa'; $text_primary = '#1d2327'; $text_secondary = '#50575e'; $text_muted = '#757575'; $divider = '#dcdcde'; $card_background = '#f6f7f7'; $body_background = '#f6f7f7'; $content_background = '#ffffff'; $font_stack = "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif"; $language = esc_attr( get_bloginfo( 'language' ) ); ?>