Sending multiple custom emails at once

Home Forums Quform WordPress Sending multiple custom emails at once

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

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

    #20152
    MGK
    Participant

    perfect, 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

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