Auto Reply Email to multiple users (email address fields)

Home Forums Quform WordPress Auto Reply Email to multiple users (email address fields)

This topic is: resolved
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #17155
    dynamicscott
    Participant

    Hi,

    I’m trying to get the auto-reply email to send to multiple email addresses (specified by the user on the form).

    I’m using the following code (form ID and unique field IDs are correct and each are using the “email address” field type):


    function mytheme_customize_autoreply($mailer, $form, $attachments)
    {

    $friendEmailIds = array('iphorm_3_8','iphorm_3_740','iphorm_3_754');
    $mailer->SingleTo = true;
    $emailValidator = new iPhorm_Validator_Email();

    foreach ($friendEmailIds as $id) {
    $email = trim($form->getValue($id));
    if ($email && $emailValidator->isValid($email)) {
    $mailer->AddAddress($email);
    }
    }

    // Get the new email content from the file autoreply-content.php
    ob_start();
    include dirname(__FILE__) . '/autoreply-content.php';
    $content = ob_get_clean();

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

    // You must return the $mailer object
    return $mailer;
    }

    I receive the auto-reply to the email address I select in the form settings page, I don’t receive a copy to any of the other fields.

    Any help would be greatly appreciated.

    Thanks in advance.

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

    #17181
    dynamicscott
    Participant

    Hi Ally,

    This worked perfectly, thanks for the fast response.

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