Home › Forums › Quform WordPress › Customize all notification emails
- This topic has 9 replies, 4 voices, and was last updated 8 years, 9 months ago by
Ally.
- AuthorPosts
- August 13, 2014 at 6:18 pm #12166
dankirsh
ParticipantSorry 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!
August 13, 2014 at 11:53 pm #12168josef777
ParticipantDid you read this article?
August 13, 2014 at 11:57 pm #12169dankirsh
ParticipantI 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.
August 14, 2014 at 12:15 am #12171josef777
ParticipantIt#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
August 14, 2014 at 1:25 pm #12180Ally
Support StaffYou 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 10 years, 8 months ago by
Ally.
August 14, 2014 at 1:32 pm #12182josef777
ParticipantThanks Ally i did not know that as well !
April 12, 2015 at 6:40 pm #14947alexandravonk
ParticipantHi,
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!
April 13, 2015 at 12:14 pm #14956Ally
Support StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
July 6, 2016 at 9:17 pm #19501alexandravonk
ParticipantHi 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.
July 11, 2016 at 8:02 pm #19506Ally
Support StaffYou 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 10 years, 8 months ago by
- AuthorPosts
- You must be logged in to reply to this topic.