Customize notification email for multiple recipients

Home Forums Quform WordPress Customize notification email for multiple recipients

This topic is: not resolved
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #27934
    Venom
    Participant

    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 3

    After 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.

    Send Multi Emails

    Regards,

    Venom

    • This topic was modified 5 years, 4 months ago by Venom.
    #27946
    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.

    #27955
    Venom
    Participant

    Hi 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

    #27969
    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 4 posts - 1 through 4 (of 4 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