conditional email styling

Home Forums Quform WordPress conditional email styling

This topic is: not resolved
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #29096
    yannis
    Participant

    Hi,
    I have used the plugin that shows labels and fields in 2 columns, in order to make the notification email more compact.
    I have also modified the file “quform-two-column-email-layout.php” to make the fonts much smaller. It works fine for a few very long forms, which can be printed in 2 pages now instead of the initial 6 pages.

    Unfortunately this affects the notification emails from all forms. I was wondering if there is a way to use this plugin for certain forms only.

    Yannis

    #29101
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #29102
    yannis
    Participant

    Dear Ally,
    thanks for the prompt reply. I must have done something wrong because the script breaks the website.
    Here is the code with your suggested addition:


    // conditional formatting - uses different scripts for email styling
    add_filter('quform_all_form_data_html', function ($content, Quform_Form $form, $showEmptyFields) {
    if (!in_array($form->getId(), array(3))) {
    return $content;
    }
    // END

    add_filter('quform_all_form_data_html', function ($content, Quform_Form $form, $showEmptyFields) {
    $newline = "\r\n";
    $content = '<table width="100%" cellpadding="3" cellspacing="0" border="0" style="table-layout: fixed; background: #ffffff; border-bottom: 1px solid #d4d4d4; box-shadow: 0 2px 7px 0 rgba(0, 0, 0, 0.07);">' . $newline;

    ... the rest of the code

    #29103
    yannis
    Participant

    sorry, I didn’t use the back ticks in my previous message

    // conditional formatting - uses different scripts for email styling
    add_filter('quform_all_form_data_html', function ($content, Quform_Form $form, $showEmptyFields) {
        if (!in_array($form->getId(), array(3))) {
            return $content;
        }
    // END
    
    add_filter('quform_all_form_data_html', function ($content, Quform_Form $form, $showEmptyFields) {
        $newline = "\r\n";
        $content = '<table width="100%" cellpadding="3" cellspacing="0" border="0" style="table-layout: fixed; background: #ffffff; border-bottom: 1px solid #d4d4d4; box-shadow: 0 2px 7px 0 rgba(0, 0, 0, 0.07);">' . $newline;
    
    ... the rest of the original code
    
    • This reply was modified 4 years, 11 months ago by yannis.
    #29107
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.
Be inspired. © 2024 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy