Beta v3.0: conditionally reply to user

level420 05 Aug, 2008
Hello everybody!

I've configured a mail form with chronoforms which sends two mails, one to the website admin and another to the users email address.

In "Forms Management > Setup emails" I've configure two mail targets, where the user replay email address contains a "Dynamic To" field which is connected to the email form field.

The problem is that the email form field is optional and in the case the email form field does not contain data a "mail system could not be initialized" is displayed in the joomla frontend after submitting the form.

How can I avoid this error message?

Thank you for your help.
GreyHead 05 Aug, 2008
Hi level420,

I'm still at at a very early stage with 'Beta 3'. Clearly the ideal would be some conditional code to supress the email if there's nothing in the field. I don't know if this is possible or not until I've done some more digging in the code.

A work around would be to set the default field value to [email]user@example.com[/email] - that way an email will always be sent but will just be dumped into a black hole if the default value is unchanged.

Bob
level420 05 Aug, 2008

Hi level420,

A work around would be to set the default field value to [email]user@example.com[/email].
Bob



So where would I put this default field value? Of course I don't want to show the user the default value in the form.
Max_admin 05 Aug, 2008
pretty hard to tell now, wait for BETA 2 and I will fix this issue, for now you have to fill the field with some value, but excuse me, why do you need this if you know it ? the form is form some other non technical user ?

Cheers

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
level420 06 Aug, 2008

pretty hard to tell now, wait for BETA 2 and I will fix this issue, for now you have to fill the field with some value, but excuse me, why do you need this if you know it ? the form is form some other non technical user ?

Cheers

Max



The use case is that I have a form where the email address is optional. In the case the user fills the email field I want to send the filled out form as a feedback to the user.

But if the user leaves the email field empty then chronoforms trys to send the form with an empty email address which leads to an error message of the joomla mailing system. Everything works as expected, but the user gets the error message in the frontend stating that something went wrong with his form submission.

The solution would be that chronoforms sends the email only if the "Dynamic To" field is non empty.
Max_admin 06 Aug, 2008
Ok, you can chronocontact.php for this final check and I may include something at the next version, you can also redirect the user after form is submitted so they don't see the error!

Cheers

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.