Customize all notification emails

Home Forums Quform WordPress Customize all notification emails

This topic is: not resolved
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #12166
    dankirsh
    Participant

    Sorry if this has been discussed, but I couldn’t find it after searching.

    Is there a way to customize all notification emails without creating a custom email for each one? For example, I would always want the width of the table to be 100% rather than what it is now. Also, I’d like it to have solid black borders, since it’s a bit tricky to read on some of my forms that have longer labels.

    Thanks!

    #12168
    josef777
    Participant

    Did you read this article?

    Custom email content

    #12169
    dankirsh
    Participant

    I did actually see that article. It seems like it is only providing instructions on how to customize the notification for a single form.

    I was hoping to customize the default formatting for all existing and future forms. The changes I want to make are not too drastic, just adding the solid border and slightly modifying the width of the table.

    #12171
    josef777
    Participant

    It#S for more than one

    This is the code for one form

    function mytheme_customize_email($mailer, $form, $attachments)
    {
    // Get the new email content from the file email-content.php
    ob_start();
    include dirname(__FILE__) . '/email-content.php';
    $content = ob_get_clean();

    // Set the email content
    $mailer->MsgHTML($content);

    // You must return the $mailer object
    return $mailer;
    }
    add_action('iphorm_pre_send_notification_email_1', 'mytheme_customize_email', 10, 3);

    this is for 2 forms


    function mytheme_customize_email($mailer, $form, $attachments)
    {
    // Get the new email content from the file email-content.php
    ob_start();
    include dirname(__FILE__) . '/email-content.php';
    $content = ob_get_clean();

    // Set the email content
    $mailer->MsgHTML($content);

    // You must return the $mailer object
    return $mailer;
    }
    add_action('iphorm_pre_send_notification_email_1', 'mytheme_customize_email', 10, 3);
    add_action('iphorm_pre_send_notification_email_2', 'mytheme_customize_email', 10, 3);

    See the difference ? and if you have more forms just copy add another line like the last one with the form ID

    #12180
    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.

    • This reply was modified 9 years, 8 months ago by Ally.
    #12182
    josef777
    Participant

    Thanks Ally i did not know that as well !

    #14947
    alexandravonk
    Participant

    Hi,

    I’m trying also to have multiple forms and i’m looking for a way to style the output in email.

    I would like to style the data from the form in standard table layout, with even rows and un-even rows are colored slightly differently (like grey/white).

    So far, i managed to apply this layout by using an html file as reference, just by changing the reference from ’email-content.php’ to ‘style-form1.html’

    I have tried the above instructions from this topic, but then it appears that the output of both forms are not styled. of course, in my case there is only one reference possible, which is style-form1.html.

    I could see two possible solutions to this problem:

    1) Is there a way to make a reference to a specific HMTL form with the style inside, depending on the form used?
    Like:
    if form 1 is used –> then use style-form1.html
    if form 2 is used –> then use style-form2.html
    (a disadvantage of this method is that for every form it creates work to setup the html file correctly and maintain it once the form is changed/updated)

    2) Would it be possible to make a few simple style rules in PHP so that regardless of the form used the output will be generated in the same simple-table-format?

    Many thanks in advance!

    #14956
    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.

    #19501
    alexandravonk
    Participant

    Hi Ally,

    I do receive the following error when data is submitted from the from and sent to my email :

    Subject); ?>
    “> “>
    getElements(); foreach ($elements as $element) : ?> isHidden() && (!$element->isEmpty() || ($element->isEmpty() && $form->getNotificationShowEmptyFields()))) : ?> getShowNameInEmail() && strlen($adminTitle = $element->getAdminTitle())) : ?>

    Would you know what causes this and how i could resolve this?
    I had been following above steps like, but this time i am not able to resolve the error.

    Thanks in advance.

    #19506
    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 10 posts - 1 through 10 (of 10 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