Home › Forums › Quform WordPress › Sending multiple custom emails at once
- This topic has 2 replies, 2 voices, and was last updated 7 years, 6 months ago by MGK.
- AuthorPosts
- October 17, 2016 at 9:23 pm #20121MGKParticipant
Hi,
I have a form where users can choose up to multiple persons they which to connect with.
Each of them would receive a personal link.I have all the part of getting the values from hidden inputs, generating unique ids etc, after first form, and on displaying personalized second form.
However, I am having troubles to send the _personalised_ emails to the selected persons !
I managed to send the same email, but not one unique link to each :function my_pre_send_notification_email($mailer, $formid, $attachments) { $recipients = (array) $formid->getValue('iphorm_1_11'); $recipients = array_slice($recipients, 1, 7); $mailer->clearAddresses(); foreach ($recipients as $recipient) { $receptientdata = array(); $receptientdata = my_get_recipient_email($recipient); $email = $receptientdata[0]; $quoteuid = $receptientdata[1]; if (PHPMailer::validateAddress($email)) { $mailer->addAddress($email); $mailer->SingleTo = true; ob_start(); include dirname(__FILE__) . '/email-content.php'; //will use $quoteuid for unique link $content = ob_get_clean(); $mailer->msgHTML($content); } } return $mailer; } add_filter('iphorm_pre_send_notification_email_1', 'my_pre_send_notification_email', 10, 3);
Could you please advise ?
Thanks !
- This topic was modified 7 years, 6 months ago by MGK.
October 21, 2016 at 5:29 pm #20149AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
October 21, 2016 at 5:36 pm #20152MGKParticipantperfect, will try that, otherwise in the meantime I called PHPmail separatly and got it working ! but will look at this method which seems cleaner !
Thanks Ally
- AuthorPosts
- You must be logged in to reply to this topic.