quform_notification_mailer_config

This hook is run before a notification email is sent. It can be used as an alternative to the hook quform_pre_send_notification when using an email sending plugin that does not use PHPMailer.

quform_notification_mailer_config_X_X

This hook is run for a single notification.

Example

12
3
4
5
6
7
add_filter('quform_notification_mailer_config_1_1', function (array $config, Quform_Notification $notification, Quform_Form $form) {    if ($form->getValue('quform_1_3') == 'Sales') {
        $config['to'][] = 'sales@example.com';
    }
 
    return $config;
}, 10, 3);
add_filter('quform_notification_mailer_config_1_1', function (array $config, Quform_Notification $notification, Quform_Form $form) {
    if ($form->getValue('quform_1_3') == 'Sales') {
        $config['to'][] = 'sales@example.com';
    }

    return $config;
}, 10, 3);
1
2
3
4
5
6
7
8
9
function my_notification_mailer_config(array $config, Quform_Notification $notification, Quform_Form $form)
{
    if ($form->getValue('quform_1_3') == 'Sales') {
        $config['to'][] = 'sales@example.com';
    }
 
    return $config;
}
add_filter('quform_notification_mailer_config_1_1', 'my_notification_mailer_config', 10, 3);
function my_notification_mailer_config(array $config, Quform_Notification $notification, Quform_Form $form)
{
    if ($form->getValue('quform_1_3') == 'Sales') {
        $config['to'][] = 'sales@example.com';
    }

    return $config;
}
add_filter('quform_notification_mailer_config_1_1', 'my_notification_mailer_config', 10, 3);

quform_notification_mailer_config

This hook is run for all notifications.

Example

1
2
3
4
5
6
7
add_filter('quform_notification_mailer_config', function (array $config, Quform_Notification $notification, Quform_Form $form) {
    if (is_user_logged_in()) {
        $config['headers'][] = 'X-Priority: 1';
    }
 
    return $config;
}, 10, 3);
add_filter('quform_notification_mailer_config', function (array $config, Quform_Notification $notification, Quform_Form $form) {
    if (is_user_logged_in()) {
        $config['headers'][] = 'X-Priority: 1';
    }

    return $config;
}, 10, 3);
1
2
3
4
5
6
7
8
9
function my_notification_mailer_config(array $config, Quform_Notification $notification, Quform_Form $form)
{
    if (is_user_logged_in()) {
        $config['headers'][] = 'X-Priority: 1';
    }
 
    return $config;
}
add_filter('quform_notification_mailer_config', 'my_notification_mailer_config', 10, 3);
function my_notification_mailer_config(array $config, Quform_Notification $notification, Quform_Form $form)
{
    if (is_user_logged_in()) {
        $config['headers'][] = 'X-Priority: 1';
    }

    return $config;
}
add_filter('quform_notification_mailer_config', 'my_notification_mailer_config', 10, 3);

Parameters

  • $configarray – the mailer configuration
  • $notificationQuform_Notification – the notification instance
  • $formQuform_Form – the form instance

Accessing form data

See Getting form values

Be inspired. © 2024 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy