Buy Now
Sign in

Sending email to address in a form field

nams09 , July 31 at 03:29
Answered
n
nams09

Hello!

I have a form which has to be confirmed by the administrator after the user sends it. There is a form field named "correo" that contains the address to where the confirmation email needs to be sent.

I have an email function and tried using {data:correo} in the recipients list but it's not working, if I use my email address the email is sent, and also if I use {user:email}, but I really need it to be sent to the address that the user fills in the form.

What could be the problem? Do I need to add something else to the recipients list?

admin

Hi nams09,

if the "correo" field has a valid email address then the email should be sent to it, you can verify this with a debugger action.

Best regards,
Max

Max
If your main question got answered then please mark the answer using the button!

GreyHead

Hi nams09,

How exactly is the admin confirming the submission? Are you saving and re-loading the form data? Does a debugger show that correo is available with the correct value?

Bob

ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much

n
nams09

Hello Greyhead,

I have a task button which the admin has to click and it calls a sendemail function, where I have {data:correo} in the recipients list. I already checked and correo has the correct value and a valid email address, so I'm really lost.

Where would I have to place the debugger action to actually verify this? In the event where I'm calling the sendemail function?

admin

Hi nams09,

Yes, a {debug:} after the send mail function will show you the data passed and under which path in order to call it in the email correctly, and the email settings used.

Best regards,
Max

Max
If your main question got answered then please mark the answer using the button!

n
nams09

Hi Max,

I'm sending you the results of the debugger action. I have another send mail function that's being called after the form is saved, and this one works correctly using {data:correo} . I don't really see much difference between the two events except for the save function I have in the other one. Do I need to have a function where I read the values of the data first? Because it seems like it isn't reading the value at all.

Attachments
correo.png
correo.png
(48.63 KiB)
57 Downloads/Views
admin

Hi nams09,

The "Recipients" section in the email debug is empty which means that you did not pass the value correctly from the "read data", please show the rest of the debug.

Best regards,
Max

Max
If your main question got answered then please mark the answer using the button!

n
nams09

Hello Max,

I added de read_data function to the email event which is something I think I was missing, but I'm still not getting the email sent. I'm attaching the new debug results.

I know maybe it's a really basic question, but am I supposed to have a different read data function than the one I already had? What I did is I took the advanced articles demo and just adapted it to my form, but I'm still figuring things out.

I'm also attaching the way my read data function is set up.

Thanks for your help Max

Attachments
read_data.jpg
read_data.jpg
(100.68 KiB)
45 Downloads/Views
debug.jpg
debug.jpg
(300.43 KiB)
46 Downloads/Views
admin

What do you have the "Recipients" box of the email now ? the recipients is empty and as long as its empty the email will not be sent

Best regards

Max
If your main question got answered then please mark the answer using the button!

n
nams09

It’s not empty. I have {data:correo} in it because I need to get the value from that field.

n
nams09

I got it Max! Turns out I was just getting the array because I wasn't linking it to a particular row. I solved it by using {var:read_correo.Becashijos.correo} instead of {data:correo} and it's working now :)

Thanks a lot for your help!