Forums

Call an email 'event' from a PHP custom code box

stikkimorey 21 Sep, 2018
Hi

I have some PHP code on a Chronoforms6 form which saves data under certain conditions. Is it possible to 'call' a chronoforms email 'event' from within the code?

Thanks
healyhatman 21 Sep, 2018
It'd be easier to just use an event switcher.
stikkimorey 21 Sep, 2018
Yes, I tried that but it's not working for me

Can I make the PHP fire off the email event?

Thanks
healyhatman 21 Sep, 2018
What do you mean it's not working?

And no I don't think you can. Might as well just use Joomla's mailer.
https://docs.joomla.org/Sending_email_from_extensions
stikkimorey 21 Sep, 2018
I tried setting the data for the event switcher to {var:loop_event67.row.book_it}

The value for book_it is either 1 or 0 so I set 1,0 in the expected results and put the email event in branch 1

But even when book_it is 0 the email fires. Is it using logical 1? Do I need to set "1","0"?
healyhatman 21 Sep, 2018
1,0 should be fine. No reason it should be reading as a 1 if it's definitely a 0. You could maybe try {value:1},{value:0}
stikkimorey 21 Sep, 2018
Thanks healyhatman but with those values nothing runs.

I'll do the email in PHP.
healyhatman 21 Sep, 2018
In the Loop, but a custom code block with just {var:loop_event67.row.book_it} and see if it actually does print out the erroneous 0 you're expecting
stikkimorey 21 Sep, 2018
Thanks buddy but I've done it in PHP now. Sometimes its just quicker to give in go old school.

Really do appreciate all the help you've been giveing me over the last months though.
This topic is locked and no more replies can be posted.