Forums

Dynamic To

ataylor14 08 Dec, 2015
Hello
I would like to send am email after receipt of payment (on ipn event) to both the buyer_email and to teh email that the person filled on the initial form (might be different than the buyer_email).

I saved the buyer details on submit to a database and I retrieve them in the ipn event using a DB Read in a data model called 'form_data'. Then I set the value of the firls 'email such:
$form->data['email']=$form->data['form_data']['email']
If I add {email} in the body of the email action the value looks the right one.

However when I set Dynamic To to be email I do not receive any emails.

How can fix this?

Thank you
Amelia
GreyHead 08 Dec, 2015
Answer
Hi Amelia,

I don't see any obvious reason why that wouldn't work. Do you have anything in the To box of the same email?

Please add this the Email template of an email that works and see what data is there
<?php
echo '<div>$form->data: '.print_r($form->data, true).'</div>';
?>

Bob
ataylor14 08 Dec, 2015
Hello Bob

I did what you advised and indeed I had the expected value in the data array for the field email. For some reason I need to use this between {}. So for example in the To: field of the email action I can write {email} and it works but not if I simply type in there email.

Thank you
Amelia
GreyHead 08 Dec, 2015
Hi Amelia,

I think that the standard To Email box now accepts {email} or xxx@domain.com - the Dynamic To box on the Advanced tab should accept just email without the {}.

But you've got it working and that's fine.

Bob
This topic is locked and no more replies can be posted.