Forum Replies Created

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • in reply to: Populate email in url #34470
    klurth
    Participant

    Hey Ally,

    thanks. This is the code I used in the functions.php:


    add_action('quform_pre_send_notification_53_7', function ($mailer, Quform_Notification $notification, Quform_Form $form) {
    ob_start();
    include __DIR__ . '/email-content.php';
    $mailer->Body = ob_get_clean();
    }, 10, 3);

    53_7 is the unique identifier of the notification.

    And this is the code within the email-conten.php:


    <?php
    $url = 'https://spieren.de/24-stunden-services/rezept-bestellen/';

    $url = add_query_arg(array(
    'vn' => urlencode($form->getValue('quform_53_3')),
    'nn' => urlencode($form->getValue('quform_53_10')),
    'gd' => urlencode($form->getValue('quform_53_11')),
    'em' => urlencode($form->getValue('quform_53_4')),
    'tf' => urlencode($form->getValue('quform_53_13')),
    'vs' => urlencode($form->getValue('quform_53_312')),
    'kk' => urlencode($form->getValue('quform_53_308')),
    'mm1' => urlencode($form->getValue('quform_53_213')),
    'ws1' => urlencode($form->getValue('quform_53_215')),
    'df1' => urlencode($form->getValue('quform_53_216')),
    'pg1' => urlencode($form->getValue('quform_53_223')),
    'mg1' => urlencode($form->getValue('quform_53_268')),
    'mt1' => urlencode($form->getValue('quform_53_273')),
    'ab1' => urlencode($form->getValue('quform_53_274')),
    'zn1' => urlencode($form->getValue('quform_53_275')),
    'am1' => urlencode($form->getValue('quform_53_277')),
    ), $url);
    <h2>Übermittelte Daten</h2>
    <div style="font-family: Arial; margin: 0px!important; padding: 0px!important;">

    Hallo {element|id:3|Vorname} {element|id:10|Nachname},

    wir haben folgende Rezeptbestellung von Ihnen erhalten:

    Neue Bestellung - hier klicken

    </div>
    <div style="font-family: Arial; margin: 0px!important; padding: 0px!important;">

    ">Erneut bestellen

    Viele Grüße,

    Ihr Team der Arztpraxis Spieren


    Im Buchwald 1 | 57482 Wenden
    Telefon: 0 27 62 / 97 57 - 0
    Telefax: 0 27 62 / 97 57 - 57
    eMail: <span style="color: #0066cc;">www.spieren.de/kontakt</span>
    Homepage: <span style="color: #0066cc;">http://www.spieren.de</span>

    Lehrarztpraxis der Universitäten Düsseldorf, Göttingen, Köln und Witten/Herdecke
    ÄKWL-Weiterbildungsstätte zum Facharzt für Allgemeinmedizin
    Gesundheitsförderung & Prävention, hausärztliche Geriatrie und Psychosomatik, Notfallmedizin, Verkehrsmedizin

    BSNR 18 84 711 00

    Facebook: facebook.com/ArztpraxisSpieren
    Instagram: instagram.com/arztpraxisspieren

    </div>
    ?>

    Thank a lot for your help!

    Best regards,
    Thomas

    in reply to: Populate email in url #34464
    klurth
    Participant

    Hey Ally,

    sorry to get to you so late. I was able to move the email content from within the form builder to a custom PHP file. Unfortunately now I get an AJAX error when trying to submit the form. If I delete the action from the funtions.php the form is submitted.

    Any idea how to solve the error?

    Best regards,
    Thomas

    in reply to: Conditional logic in combination with date value #33870
    klurth
    Participant

    Hey Ally,

    thank you! You can mark this thread as solved.

    Best regards,
    Thomas

    in reply to: Conditional logic in combination with date value #33816
    klurth
    Participant

    Hi Ally,

    yes, it is a date field. I’m using conditional logic in combination with the date field and the javascript calculations above. To be more specific: If the days between field 1_3 and the hidden field 1_4 are less then 28 field 1_9 ($datePlus28) should be displayed. In this case it is not necessary to submit the form.

    But the field 1_9 is not displayed if the the date format in field 1_3 is dd.mm.yy and not dd.mm.yyyyy.

    So my first Idea was to check if the date format is valid and notificate the user.

    Alternatively I wondered to switch off the input option and only use the date picker. That would be fine for me as well. While using the date picker it works as expected.

    Regards,
    Thomas

    in reply to: Conditional logic in combination with date value #33810
    klurth
    Participant

    Many thanks again, Ally!

    OK, will do 🙂

    Is it possible to validate a date field, check the date format immediately and print out an error message, if the format is wrong? For example: I need to have the format dd.mm.yyyy but the user inputs dd.mm.yy. Error message could be sth. like this: “Please enter the correct date format” Or is it even possible to change the input into the right format automatically?

    Regards,
    Thomas

    in reply to: Conditional logic in combination with date value #33799
    klurth
    Participant

    Hey Ally,

    once again thanks a lot! It also works perfectly. May I disturb you one more time? It’s really the last time. I promise 🙂

    How can I add a specific number of days to a date? For example: date is entered in field 1_3, let’s say 09.12.2021. And I want to add 21 days to show in another field (1_8) to output 30.12.2021 and add 28 days to output 06.01.2022 in field 1_9.

    Thanks again and enjoy your coffee 😉

    Regards,
    Thomas

    in reply to: Conditional logic in combination with date value #33792
    klurth
    Participant

    Hey Ally,

    wow! Thanks a lot for the quick response and the solution. Works like a charm!

    Advanced question… Is it possible to adjust the code to count days instead of months? I tried some changes, but I’m a newbie to javascript 🙁

    And I’d like to buy you a coffee for your awesome work. Do you have a donation link?

    Regards,
    Thomas

    klurth
    Participant

    Hey Ally,

    thanks for your response and the solution for the problem. That makes sense to me and we will exclude the pages forms from the cache.

    Best Regards,

    Thomas Klur music + media

Viewing 8 posts - 1 through 8 (of 8 total)
Be inspired. © 2025 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy