Home › Forums › Quform WordPress › Customize notification email for multiple recipients
- This topic has 3 replies, 2 voices, and was last updated 5 years, 4 months ago by Ally.
- AuthorPosts
- December 2, 2018 at 2:28 pm #27934VenomParticipant
Hi Ally,
Is there a way to make use the quform_pre_send_notification action to send the notification email multiple times. I have a form with multiple rows,
Row 1: Name 1, Email 1 , Subject 1, Content 1
Row 2: Name 2, Email 2 , Subject 2, Content 2
Row 3: Name 3, Email 3 , Subject 3, Content 3After submitting the form, Quform would send multiple notification emails based on the content in Row 1-3 provided by users.
3 emails with different content, address and subject will be sent out.I tried to put the following code snippet in quform_pre_send_notification action, but it will throw exception and keep looping.
function my_customize_autoreply_80_1($mailer, $notification, $form) wp_mail('email', 'AAA', 'ABCD', 'Content-Type: text/html'); return $mailer; } dd_filter('quform_pre_send_notification_80_1', 'my_customize_autoreply_80_1', 10, 3);
I tried to follow the sample below but it is for Quform v1 only.
Regards,
Venom
- This topic was modified 5 years, 4 months ago by Venom.
December 3, 2018 at 3:53 pm #27946AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
December 4, 2018 at 12:52 am #27955VenomParticipantHi Ally,
If I use the quform_post_process hook, is it still possible to get the notification object and existing mail setting object? I need to send the email enclosed with the attachment added in the notification setting.
$config = $notification->getDefaultConfig();
$attachments = $notification->config('attachments');
foreach ($attachments as $attachment) {
if (is_array($attachment['media'])) {
foreach ($attachment['media'] as $medium) {
$post = get_post($medium['id']);if ($post instanceof WP_Post && $post->post_type == 'attachment') {
$file = get_attached_file($post->ID);if (is_file($file)) {
$config['attachments'][] = $file;
}
}
}
}
}
Regards,
Venom
December 7, 2018 at 12:17 pm #27969AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
- AuthorPosts
- You must be logged in to reply to this topic.