calling code before or after e-mail

rankman 17 Jul, 2007
Hello,

If you don't use the option to send the results to e-mail the possibility to run php code before sending e-mail is not working correctly.

The code runs but the "form data" is not send via "Post" to this php code.

The possibility to run php code after sending e-mail is working correctly. The "form data" is send via "Post" to this php code.

Does anyone experience the same of have an explantion for this?

Regards,

Robert
GreyHead 17 Jul, 2007
Hi Robert,

It's just the way the code is written. The instructions are inside the loop that sends the e-mails.

If you aren't sending e-mails then just put all your code into the 'After email' box and it will be executed before the MySQL query.

Bob
rankman 17 Jul, 2007
Bob,

That's exactly the way I do it now.
I was wondering if this keeps working in further releases because the option is "to run code after sending e-mail" and i'm not doing this. Maybe it's a translation issue and should it be "running code after sending the form".




Regards,

Robert
GreyHead 17 Jul, 2007
Hi Robert,

Hmm, I can't read Max's mind but I'd guess that it's just a happenstance issue. He added the 'before' code a couple of releases ago and the way the code is structured it happened to end up in the e-mail 'if' clause.

I agree it would be cleaner to have it run whether or not e-mails are sent; and probably before any ChronoForms processing is done.

Bob
Max_admin 18 Jul, 2007
Hi Robert,Bob,

Its some kind of translation issue yes, indeed I couldn't find an event to use so I can differ both the 2 actions (before and after), the only clear event which can be used here is the "email" I think, you know since more than 90% of users use it for emails!!🙂

The function has been made based on a user request and it was very helpful, do you suggest another name for them ?

Thanks,

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
GreyHead 18 Jul, 2007
Hi Max,

Thinking about it - it seems good as it is. Maybe the help needs a tweak (I don't remember what it says).

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