Home › Forums › Quform WordPress › Auto Reply Email to multiple users (email address fields)
- This topic has 2 replies, 2 voices, and was last updated 8 years, 6 months ago by dynamicscott.
- AuthorPosts
- October 19, 2015 at 11:59 am #17155dynamicscottParticipant
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.
October 19, 2015 at 3:53 pm #17166AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
October 20, 2015 at 1:48 pm #17181dynamicscottParticipantHi Ally,
This worked perfectly, thanks for the fast response.
- AuthorPosts
- You must be logged in to reply to this topic.