'array',
'sanitize_callback' => array( Settings::class, 'sanitize' ),
'default' => Settings::defaults(),
)
);
$page = Admin::SETTINGS_PAGE;
add_settings_section( 'tracking', __( 'Tracking', 'dealroot' ), array( $this, 'tracking_intro' ), $page );
add_settings_field(
'tracking_enabled',
__( 'Track lead sources', 'dealroot' ),
array( $this, 'field_checkbox' ),
$page,
'tracking',
array(
'key' => 'tracking_enabled',
'label' => __( 'Remember how visitors arrived and attach it to their form submissions', 'dealroot' ),
)
);
add_settings_field( 'cookie_days', __( 'Remember visits for', 'dealroot' ), array( $this, 'field_cookie_days' ), $page, 'tracking' );
add_settings_field( 'consent_mode', __( 'Cookie consent', 'dealroot' ), array( $this, 'field_consent' ), $page, 'tracking' );
add_settings_field(
'count_visits',
__( 'Visits', 'dealroot' ),
array( $this, 'field_checkbox' ),
$page,
'tracking',
array(
'key' => 'count_visits',
'label' => __( 'Count visits per channel to show conversion rates (anonymous daily totals, no personal data)', 'dealroot' ),
)
);
add_settings_field(
'live_view',
__( 'Live view', 'dealroot' ),
array( $this, 'field_checkbox' ),
$page,
'tracking',
array(
'key' => 'live_view',
'label' => __( 'Show who is on the site right now: the page, where they came from and the form they are filling in (kept for ten minutes, never what is typed)', 'dealroot' ),
)
);
add_settings_field( 'geo_cities', __( 'Cities of visitors', 'dealroot' ), array( $this, 'field_geo_cities' ), $page, 'tracking' );
add_settings_field(
'form_stats',
__( 'Form analytics', 'dealroot' ),
array( $this, 'field_checkbox' ),
$page,
'tracking',
array(
'key' => 'form_stats',
'label' => __( 'Count how many visitors start each form, send it, and at which field they give up (anonymous daily totals, never what was typed)', 'dealroot' ),
)
);
add_settings_field(
'track_clicks',
__( 'Contact clicks', 'dealroot' ),
array( $this, 'field_checkbox' ),
$page,
'tracking',
array(
'key' => 'track_clicks',
'label' => __( 'Count clicks on phone numbers, WhatsApp, email, Telegram, Viber and map links by channel', 'dealroot' ),
)
);
add_settings_field(
'data_layer',
__( 'Tag managers', 'dealroot' ),
array( $this, 'field_checkbox' ),
$page,
'tracking',
array(
'key' => 'data_layer',
'label' => __( 'Add a generate_lead event to the dataLayer when a visitor sends a form, with the source, campaign and keyword, so Google Tag Manager can start your own tags with it (works with GTM4WP)', 'dealroot' ),
)
);
add_settings_section( 'ai', __( 'AI assistant', 'dealroot' ), '__return_false', $page );
add_settings_field( 'ai_enabled', __( 'AI assistant', 'dealroot' ), array( $this, 'field_ai' ), $page, 'ai' );
add_settings_field( 'team_lang', __( 'Languages', 'dealroot' ), array( $this, 'field_languages' ), $page, 'ai' );
add_settings_section( 'forms', __( 'Forms', 'dealroot' ), array( $this, 'forms_intro' ), $page );
add_settings_field(
'found_forms',
__( 'Forms the scan misses', 'dealroot' ),
array( $this, 'field_checkbox' ),
$page,
'forms',
array(
'key' => 'found_forms',
'label' => __( 'Save a form with an email address, phone number or message field as soon as a visitor sends it, also when the scan did not find it, e.g. a checkout or a form in a pop-up. It is listed on the Forms screen, where you can switch it off. Newsletter sign-ups are only listed.', 'dealroot' ),
)
);
add_settings_field(
'form_alarm',
__( 'Alarm', 'dealroot' ),
array( $this, 'field_checkbox' ),
$page,
'forms',
array(
'key' => 'form_alarm',
'label' => __( 'Tell me at once when a form seems broken: no enquiry for days while visitors come as usual, forms that are sent but never arrive, or a site that cannot send emails – in Telegram, otherwise by email', 'dealroot' ),
)
);
add_settings_field(
'smart_form',
__( 'Hints in forms', 'dealroot' ),
array( $this, 'field_checkbox' ),
$page,
'forms',
array(
'key' => 'smart_form',
'label' => __( 'While a visitor writes a message, show a short hint below it when something your enquiries usually lack is missing, e.g. “Mention the date – you get an offer faster.” Learned from your enquiries with the AI assistant; checked in the browser, nothing is sent.', 'dealroot' ),
)
);
add_settings_field( 'capture_selector', __( 'Other forms', 'dealroot' ), array( $this, 'field_capture_selector' ), $page, 'forms' );
add_settings_field( 'mail_tags', __( 'Notification emails', 'dealroot' ), array( $this, 'field_mail_tags' ), $page, 'forms' );
if ( class_exists( '\\WooCommerce' ) ) {
add_settings_field(
'woocommerce_orders',
'WooCommerce',
array( $this, 'field_checkbox' ),
$page,
'forms',
array(
'key' => 'woocommerce_orders',
'label' => __( 'Save every order as a lead and mark it as won when it is paid', 'dealroot' ),
)
);
}
add_settings_section( 'sales', __( 'Sales', 'dealroot' ), '__return_false', $page );
add_settings_field( 'currency', __( 'Default currency', 'dealroot' ), array( $this, 'field_currency' ), $page, 'sales' );
add_settings_field(
'purchase_orders',
__( 'Orders', 'dealroot' ),
array( $this, 'field_checkbox' ),
$page,
'sales',
array(
'key' => 'purchase_orders',
'label' => __( 'Save the orders your shop reports to Google Analytics or Google Ads as a purchase as won deals, with order number and amount. If the visitor sent the checkout form before, that lead is marked as won. Orders of WooCommerce are saved by its own integration.', 'dealroot' ),
)
);
add_settings_field( 'gads_conversion', __( 'Won deals in Google Ads and Microsoft Advertising', 'dealroot' ), array( $this, 'field_conversion_names' ), $page, 'sales' );
add_settings_field( 'phone_country', __( 'Phone numbers', 'dealroot' ), array( $this, 'field_phone_country' ), $page, 'sales' );
add_settings_section( 'telegram', __( 'Telegram notifications', 'dealroot' ), array( $this, 'telegram_intro' ), $page );
add_settings_field(
'telegram_enabled',
__( 'Notify', 'dealroot' ),
array( $this, 'field_checkbox' ),
$page,
'telegram',
array(
'key' => 'telegram_enabled',
'label' => __( 'Send a Telegram message for every new lead', 'dealroot' ),
)
);
add_settings_field(
'telegram_weekly',
__( 'Weekly', 'dealroot' ),
array( $this, 'field_checkbox' ),
$page,
'telegram',
array(
'key' => 'telegram_weekly',
'label' => __( 'Every Monday morning, send the week in a few sentences: how many leads came, from where, and what changed', 'dealroot' ),
)
);
add_settings_field(
'telegram_morning',
__( 'Mornings', 'dealroot' ),
array( $this, 'field_checkbox' ),
$page,
'telegram',
array(
'key' => 'telegram_morning',
'label' => __( 'Every morning at 8:00, send what came in since the day before, which enquiries look promising, which still wait for an answer and what was won', 'dealroot' ),
)
);
add_settings_field(
'remind_waiting',
__( 'Reminder', 'dealroot' ),
array( $this, 'field_checkbox' ),
$page,
'telegram',
array(
'key' => 'remind_waiting',
'label' => __( 'Remind me when a promising enquiry – urgent, an order, with a budget or from a customer who bought before – has waited 30 minutes for an answer', 'dealroot' ),
)
);
add_settings_field( 'telegram_token', __( 'Bot token', 'dealroot' ), array( $this, 'field_telegram_token' ), $page, 'telegram' );
add_settings_field( 'telegram_chat_id', __( 'Chat ID', 'dealroot' ), array( $this, 'field_telegram_chat' ), $page, 'telegram' );
add_settings_section( 'mail', __( 'Emails', 'dealroot' ), array( $this, 'mail_intro' ), $page );
add_settings_field( 'mail_sender', __( 'Sender', 'dealroot' ), array( $this, 'field_mail_sender' ), $page, 'mail' );
add_settings_field( 'mail_look', __( 'Look', 'dealroot' ), array( $this, 'field_mail_look' ), $page, 'mail' );
add_settings_field( 'digest_recipients', __( 'Emails for you', 'dealroot' ), array( $this, 'field_digest_recipients' ), $page, 'mail' );
add_settings_section( 'away', __( 'Away', 'dealroot' ), '__return_false', $page );
add_settings_field( 'away', __( 'Holiday', 'dealroot' ), array( '\\Dealroot\\Away', 'fields' ), $page, 'away' );
add_settings_section( 'webhook', __( 'Webhook', 'dealroot' ), array( $this, 'webhook_intro' ), $page );
add_settings_field( 'webhook_url', __( 'Endpoint URL', 'dealroot' ), array( $this, 'field_webhook_url' ), $page, 'webhook' );
add_settings_field( 'webhook_secret', __( 'Signing secret', 'dealroot' ), array( $this, 'field_webhook_secret' ), $page, 'webhook' );
add_settings_section( 'digest', __( 'Weekly summary', 'dealroot' ), '__return_false', $page );
add_settings_field(
'digest_enabled',
__( 'Email', 'dealroot' ),
array( $this, 'field_checkbox' ),
$page,
'digest',
array(
'key' => 'digest_enabled',
'label' => __( 'Send a summary of leads, deals and contact clicks every Monday morning', 'dealroot' ),
)
);
add_settings_field( 'digest_send', __( 'Now', 'dealroot' ), array( $this, 'field_digest_send' ), $page, 'digest' );
add_settings_section( 'replies', __( 'Quick replies', 'dealroot' ), array( $this, 'replies_intro' ), $page );
add_settings_field( 'replies', __( 'Replies', 'dealroot' ), array( $this, 'field_replies' ), $page, 'replies' );
add_settings_section( 'privacy', __( 'Privacy', 'dealroot' ), '__return_false', $page );
add_settings_field( 'retention_days', __( 'Delete leads after', 'dealroot' ), array( $this, 'field_retention' ), $page, 'privacy' );
add_settings_field( 'site_icons', __( 'Website icons', 'dealroot' ), array( $this, 'field_site_icons' ), $page, 'privacy' );
add_settings_field(
'delete_on_uninstall',
__( 'Uninstall', 'dealroot' ),
array( $this, 'field_checkbox' ),
$page,
'privacy',
array(
'key' => 'delete_on_uninstall',
'label' => __( 'Delete all leads and settings when the plugin is deleted', 'dealroot' ),
)
);
}
/**
* Groups of the sections, in the order shown.
*
* @return array ' . esc_html__( 'Summary sent.', 'dealroot' ) . ' ' . esc_html__( 'The summary could not be sent. Check that your site can send email.', 'dealroot' ) . ' ' . esc_html__( 'Test lead sent to the webhook.', 'dealroot' ) . ' ' . esc_html( sprintf( __( 'The webhook could not be delivered: %s', 'dealroot' ), $error ) ) . ' ' . esc_html__( 'Test message sent. Check your Telegram chat.', 'dealroot' ) . ' ' . esc_html( sprintf( __( 'Telegram returned an error: %s', 'dealroot' ), $error ) ) . ' ' . esc_html__( 'Dealroot stores the first and the most recent way each visitor reached your site in a first-party cookie. Nothing is sent to external servers.', 'dealroot' ) . ' ' . esc_html__( 'Create a bot with @BotFather, add it to a chat or group, then paste the token and the chat ID here. @userinfobot shows your personal chat ID.', 'dealroot' ) . ' ' . esc_html__( 'With the AI assistant on, the bot also works for you: tell it about a call in a voice message and it becomes a lead, linked to the click on your phone number; say “Müller won, 1,500 euros”, “remind me on Friday about Schmidt” or ask about your numbers; paste or forward a WhatsApp chat or an email and it becomes a lead. Send /help to the bot for examples.', 'dealroot' ) . ' ' . esc_html__( 'The country comes from the time zone of the visitor’s browser or from your CDN. For cities, your server downloads the free DB-IP Lite database once a month (about 60 MB, 130 MB unpacked) and looks up each visitor itself. IP addresses are not sent anywhere and not stored, only the city and country.', 'dealroot' ) . ' ' . esc_html__( 'IP Geolocation by DB-IP', 'dealroot' ) . ' ' . esc_html( $text ) . ' ' . esc_html( $line ) . '';
foreach ( $check['databases'] as $name => $found ) {
$text = '' !== $found['place'] ? $found['place'] : __( 'not known', 'dealroot' );
if ( $found['radius'] ) {
/* translators: 1: city and country, 2: kilometres */
$text = sprintf( __( '%1$s, within about %2$s km', 'dealroot' ), $text, number_format_i18n( $found['radius'] ) );
}
printf(
'
';
}
}
/**
* The optional MaxMind database, with its account ID and license key.
*/
private function geo_maxmind() {
$status = Geo_Maxmind::status();
$key = Settings::get( 'maxmind_key' );
?>
' . esc_html__( 'Leads and orders that give a postcode or a town are placed there instead, which is exact to the town. For this, your server downloads the free postcode list of GeoNames for each country your leads come from.', 'dealroot' ) . ' GeoNames
'; if ( $names ) { /* translators: %s: list of countries */ echo '' . esc_html( sprintf( __( 'Postcode lists: %s.', 'dealroot' ), implode( ', ', $names ) ) ) . '
'; } } /** * Icons of the sources in the reports. */ public function field_site_icons() { printf( '', esc_attr( Settings::OPTION ), checked( Site_Icons::enabled(), true, false ), esc_html__( 'Show the icons of search engines, social networks and other websites in the reports', 'dealroot' ) ); echo '' . esc_html__( 'Your server loads each icon once from the website itself and keeps it for a month. Nothing about you, your site or your visitors is sent.', 'dealroot' ) . '
'; } /** * Cookie lifetime. */ public function field_cookie_days() { printf( ' %3$s%4$s
', esc_attr( Settings::OPTION ), (int) Settings::get( 'cookie_days' ), esc_html__( 'days', 'dealroot' ), esc_html__( 'Google Ads accepts offline conversions for clicks up to 90 days old.', 'dealroot' ) ); } /** * Consent mode. */ public function field_consent() { $current = Settings::get( 'consent_mode' ); $options = array( 'none' => __( 'Track without waiting for consent', 'dealroot' ), 'wp_consent_api' => __( 'Wait for marketing consent from my cookie banner: Google Consent Mode v2, Cookiebot, CookieYes, Complianz, or any banner with the WP Consent API', 'dealroot' ), 'custom' => __( 'Wait until my consent tool calls dealroot.grantConsent()', 'dealroot' ), ); foreach ( $options as $value => $label ) { printf( '', esc_attr( Settings::OPTION ), esc_attr( $value ), checked( $current, $value, false ), esc_html( $label ) ); } echo '' . esc_html__( 'In the EU, campaign tracking usually requires prior consent. Ask your legal advisor which option fits your site.', 'dealroot' ) . '
'; } /** * Currency. */ public function field_currency() { printf( '%3$s
', esc_attr( Settings::OPTION ), esc_attr( Settings::get( 'currency' ) ), esc_html__( 'Three-letter code such as EUR, USD, GBP, PLN or UAH.', 'dealroot' ) ); } /** * Conversion names used in the offline conversion exports, with how to set them up. */ public function field_conversion_names() { $platforms = array( 'gads_conversion' => array( 'title' => 'Google Ads', 'format' => 'google_ads', 'url' => 'https://ads.google.com/aw/conversions', 'steps' => array( __( 'Open Goals → Conversions in Google Ads and click “New conversion action”.', 'dealroot' ), __( 'Choose Import, then “Other data sources or CRMs” and “Track conversions from clicks”.', 'dealroot' ), __( 'Paste the name below, choose the category “Purchase” and “Use different values for each conversion”.', 'dealroot' ), __( 'Set it as a secondary action. Your existing conversions and bidding stay as they are; you can make it primary later.', 'dealroot' ), ), ), 'msads_conversion' => array( 'title' => 'Microsoft Advertising', 'format' => 'microsoft_ads', 'url' => 'https://ui.ads.microsoft.com/campaign/vnext/conversiongoals', 'steps' => array( __( 'Open Conversions → Conversion goals in Microsoft Advertising and create a new goal.', 'dealroot' ), __( 'Choose the category “Purchase” and the type “Offline conversions”.', 'dealroot' ), __( 'Paste the name below and choose “Conversion values may vary”.', 'dealroot' ), ), ), ); echo '' . esc_html__( 'Your existing conversions, for example form submissions counted by the Google tag, cannot receive uploaded sales. Won deals need one extra conversion of the import type. Set it up once, then download the file under Export on the Leads screen and upload it there.', 'dealroot' ) . '
'; foreach ( $platforms as $key => $platform ) { $field = 'dealroot-' . str_replace( '_', '-', $key ); ?> ' . esc_html__( 'Dealroot Pro sends won deals to Google Ads, Microsoft Advertising and Meta by itself, without files.', 'dealroot' ) . ' ' . esc_html__( 'About Dealroot Pro', 'dealroot' ) . ''; } echo '%3$s', esc_attr( Settings::OPTION ), checked( (bool) Settings::get( 'ai_enabled' ), true, false ), esc_html__( 'Let the AI assistant read each enquiry: a summary in one sentence, its topics, whether it is urgent or spam, and a first draft of your answer on request', 'dealroot' ) ); echo '
' . esc_html__( 'Works right away, without an account or key. The text of the enquiry goes to the AI service of Dealroot in the EU, without email addresses and phone numbers, and is not stored there. Its language model runs at Mistral AI in France or on the server of Dealroot. Fast answers are free up to a monthly allowance, Dealroot Pro includes more; past it, a slower model goes on answering.', 'dealroot' ) . '
'; printf( '', esc_attr( Settings::OPTION ), checked( (bool) Settings::get( 'ai_spam' ), true, false ), esc_html__( 'Move enquiries the assistant sees as spam to Spam, without a notification', 'dealroot' ) ); printf( '', esc_attr( Settings::OPTION ), checked( (bool) Settings::get( 'ai_confirm' ), true, false ), esc_html__( 'Confirm each new enquiry by email within a minute', 'dealroot' ) ); echo '' . esc_html( sprintf( /* translators: %s: email address */ __( 'The person gets a short personal email: thanks, what they asked for, and up to two questions about what is still missing for your offer, such as the date or the address. Nothing is promised in your name. Replies go to %s.', 'dealroot' ), get_option( 'admin_email' ) ) ) . '
'; printf( '', esc_attr( Settings::OPTION ), checked( (bool) Settings::get( 'learn_style' ), true, false ), esc_html__( 'Write drafts in my style, learned from the answers I send', 'dealroot' ) ); $learned = Reply_Style::count(); echo '' . esc_html( $learned /* translators: %s: number of answers */ ? sprintf( _n( 'Learned from %s answer you sent through Dealroot, also after you changed a draft. Kept on your site only, without names, email addresses and phone numbers.', 'Learned from the last %s answers you sent through Dealroot, also after you changed a draft. Kept on your site only, without names, email addresses and phone numbers.', $learned, 'dealroot' ), number_format_i18n( $learned ) ) : __( 'Each answer you send from a lead or from Telegram teaches the drafts how you greet, close and write. Kept on your site only, without names, email addresses and phone numbers.', 'dealroot' ) ) . '
'; if ( $learned ) { printf( '', esc_attr( Settings::OPTION ), esc_html__( 'Forget the answers learned so far', 'dealroot' ) ); } echo '' . esc_html__( 'With Telegram alerts, each message about a new lead gets a button: the assistant writes the answer, and you send it to the person from Telegram, or change it first by replying to it. This needs a site with HTTPS.', 'dealroot' ) . '
'; if ( ! Settings::get( 'ai_enabled' ) ) { return; } if ( '' !== $state['error'] && ! Ai::enabled() ) { echo '' . esc_html( $state['error'] ) . '
'; return; } $usage = Ai::enabled() ? Ai::refresh_usage() : array(); if ( ! empty( $usage['analyze']['limit'] ) ) { echo '' . esc_html( sprintf( /* translators: 1: summaries used, 2: summaries allowed, 3: drafts used, 4: drafts allowed, 5: date */ __( 'This month: %1$s of %2$s summaries and %3$s of %4$s drafts used. Renewed on %5$s.', 'dealroot' ), number_format_i18n( $usage['analyze']['used'] ), number_format_i18n( $usage['analyze']['limit'] ), number_format_i18n( $usage['draft']['used'] ), number_format_i18n( $usage['draft']['limit'] ), wp_date( get_option( 'date_format' ), $usage['resets'] ? $usage['resets'] : strtotime( 'first day of next month' ) ) ) . ( ! empty( $usage['voice']['limit'] ) ? ' ' . sprintf( /* translators: 1: voice messages used, 2: voice messages allowed */ __( 'Voice messages: %1$s of %2$s.', 'dealroot' ), number_format_i18n( $usage['voice']['used'] ), number_format_i18n( $usage['voice']['limit'] ) ) : '' ) ) . '
'; } $own = $usage['own'] ?? null; if ( ! $own && ! empty( $usage['slow'] ) && ( $usage['analyze']['used'] >= $usage['analyze']['limit'] || $usage['draft']['used'] >= $usage['draft']['limit'] ) && ! empty( $usage['analyze']['limit'] ) ) { echo '' . esc_html( sprintf( /* translators: %s: date */ __( 'The fast answers of this month are used up. Until %s a slower model on the server of Dealroot answers instead – everything keeps working, it only takes longer.', 'dealroot' ), wp_date( get_option( 'date_format' ), $usage['resets'] ? $usage['resets'] : strtotime( 'first day of next month' ) ) ) ) . '
'; } $this->own_model( $usage ); } /** * Your own language model, with Dealroot Pro. * * @param array $usage Allowance and own model, as the service reports them. */ private function own_model( array $usage ) { $own = $usage['own'] ?? null; $pro = 'pro' === Ai::state()['plan']; ?>
' . esc_html( $code ) . ' ' . esc_html( $label );
}
/* translators: %s: list of placeholders such as {first_name} */
echo '' . wp_kses( sprintf( __( 'Placeholders: %s. Leave the text empty to remove a reply.', 'dealroot' ), implode( ', ', $codes ) ), array( 'code' => array() ) ) . '
'; } /** * Retention period. */ public function field_retention() { printf( ' %3$s%4$s
', esc_attr( Settings::OPTION ), (int) Settings::get( 'retention_days' ), esc_html__( 'days', 'dealroot' ), esc_html__( '0 keeps leads until you delete them.', 'dealroot' ) ); } /** * Forms section intro. */ public function forms_intro() { $active = \Dealroot\Health::active_integrations(); echo ''; if ( $active ) { /* translators: %s: list of form plugins */ echo esc_html( sprintf( __( 'Captured automatically: %s.', 'dealroot' ), implode( ', ', $active ) ) ) . ' '; } echo esc_html__( 'To see every form on your site, including forms built without a form plugin and forms embedded from other services, and to choose which ones count as leads, scan your site on the Forms screen.', 'dealroot' ) . ' ' . esc_html__( 'Open the Forms screen', 'dealroot' ) . '
'; } /** * CSS selector of additional forms. */ public function field_capture_selector() { printf( '%3$s
', esc_attr( Settings::OPTION ), esc_attr( Settings::get( 'capture_selector' ) ), esc_html__( 'For developers: CSS selectors of further forms to capture, separated by commas. To add one form, use "Add a form by hand" on the Forms screen instead, where it is listed with the others.', 'dealroot' ) ); } /** * Default country for phone numbers. */ public function field_phone_country() { $current = Settings::get( 'phone_country' ); $countries = array_keys( Phone::CALLING_CODES ); $names = array(); foreach ( $countries as $code ) { $names[ $code ] = class_exists( '\\Locale' ) ? \Locale::getDisplayRegion( '-' . $code, get_user_locale() ) : $code; } asort( $names ); printf( ''; echo '' . esc_html__( 'Numbers entered without a country code are treated as numbers from this country, so you can call or message them on WhatsApp in one click.', 'dealroot' ) . '
'; } /** * Webhook section intro. */ public function webhook_intro() { echo '' . esc_html__( 'Send every new lead and every status change as JSON to Make, Zapier, n8n or your own system. From there you can forward leads to WhatsApp, Slack, Microsoft Teams, Google Sheets or any CRM.', 'dealroot' ) . '
'; } /** * Webhook URL with test button. */ public function field_webhook_url() { printf( '', esc_attr( Settings::OPTION ), esc_attr( Settings::get( 'webhook_url' ) ) ); if ( Settings::get( 'webhook_url' ) ) { $url = wp_nonce_url( admin_url( 'admin-post.php?action=dealroot_test_webhook' ), 'dealroot_test_webhook' ); echo '' . esc_html__( 'Send test lead', 'dealroot' ) . '
'; } } /** * Webhook signing secret. */ public function field_webhook_secret() { printf( '%3$s
', esc_attr( Settings::OPTION ), esc_attr( Settings::masked_token( Settings::get( 'webhook_secret' ) ) ), esc_html__( 'Optional. When set, each request carries an X-Dealroot-Signature header with an HMAC-SHA256 of the body.', 'dealroot' ) ); } /** * Where the emails for the owner go, and whether each new enquiry comes by email too. */ public function field_digest_recipients() { printf( '%4$s
', esc_attr( Settings::OPTION ), esc_attr( Settings::get( 'digest_recipients' ) ), esc_attr( get_option( 'admin_email' ) ), esc_html__( 'The weekly summary, the alarm about broken forms and other emails for you. Separate several addresses with commas; empty means the email address of the site admin.', 'dealroot' ) ); printf( '%4$s
', esc_attr( Settings::OPTION ), checked( (bool) Settings::get( 'notify_new' ), true, false ), esc_html__( 'Email me each new enquiry', 'dealroot' ), esc_html__( 'With what the AI assistant read, where the person came from and buttons to answer. Your form plugin usually sends its own email too; you can turn that one off then.', 'dealroot' ) ); } /** * The weekly summary, sent now. */ public function field_digest_send() { $url = wp_nonce_url( admin_url( 'admin-post.php?action=dealroot_test_digest' ), 'dealroot_test_digest' ); echo '' . esc_html__( 'Send summary now', 'dealroot' ) . '
'; } /** * What the emails section is about. */ public function mail_intro() { echo '' . esc_html__( 'The emails to the people who write to you – confirmations, answers, offers – and the emails for you.', 'dealroot' ) . '
'; } /** * Name and address the emails come from, and where replies go. */ public function field_mail_sender() { $from = (string) Settings::get( 'mail_from' ); $foreign = '' !== $from && ! \Dealroot\Mail::own_domain( $from ); $host = (string) preg_replace( '/^www\./', '', (string) wp_parse_url( home_url(), PHP_URL_HOST ) ); ?>
{dealroot_attribution} {dealroot_channel} {dealroot_source} {dealroot_campaign}';
echo '' . esc_html__( 'Put these tags into the notification email of any form to see where the lead came from. They work with every form plugin.', 'dealroot' ) . '
'; } }