Can you detect Admin > Entries-mode v's Email notification mode?

Home Forums Quform WordPress Can you detect Admin > Entries-mode v's Email notification mode?

This topic is: resolved
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #25526
    katw
    Participant

    I want to change the html code wrapped around the values submitted for the email field, file upload field and multi-select checkbox fields.

    I have found the hook “quform_get_value_html_X_X” but as the description says this hook is used for both notifications and entry view.

    I want them styled differently not the same.

    Q1. Is there a way to apply changes using this hook to a specific context (ie entry-view v’s notification)?

    Q1-B. Is there a switch or flag I can query to detect the mode and do custom formatting for each?

    My idea:

    add_filter('quform_get_value_html_1_5', function ($value, Quform_Element_Field $element, Quform_Form $form) {
    
        if ($isEntryView) {
            /* leave as formatted with mailto hyperlink */
        } else {
           /* reformat no emailhyperlink */
             return '<span style="color:blue;">' . $form->getValue('quform_1_5') . '</span>';
        }
    }, 10, 3);

    Q2. Does the custom code always have to return a value or will underlying code become the default if custom code returns nothing?

    In my example above I don’t return anything for entry-view as I am happy with normal output given.

    Q3. Using the getValue() function to access the raw field value, do I have to ‘escape’ the field contents like you did in getValueHTML before using it? (Quform::escape($fielddata))

    • This topic was modified 7 years ago by katw. Reason: Added question about escaping string contents when doing my own wrapper
    #25587
    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.

    #25605
    katw
    Participant

    Which environmental value would HTML Email notifications use?

    #25606
    katw
    Participant

    A small request.

    Could you in next release add class names to the html lists you auto generate for notifications for multi-select, checkbox and file elements.

    I.E Change the getValueHtml() function to add a CLASS name. A different one for files, checkbox and multi-select elements as styling may need to be different.

    Using advanced selectors in email html is not possible. The ideal solution is a custom setting where we can define the custom inline style we want attached to the UL and another for the LI elements.

    You would then insert a style=”<our code>” to the UL, and the other style code to each LI

    Give it thought.

    • This reply was modified 6 years, 12 months ago by katw. Reason: added function I was referring to
    • This reply was modified 6 years, 12 months ago by Ally.
    #25651
    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.

    #26367
    katw
    Participant

    Thank you,

    your help was awesome.

    Close ticket

Viewing 6 posts - 1 through 6 (of 6 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