Include custom code results in email

Patrick007 30 Dec, 2015
I'm trying to pass the results of some code to the email handler so the results can be included in email.

I've used the Custom element in the designer and it renders out as I want it but I see no way of including the results in the email like other elements with the field ID.

Then I tried the Hidden element and the Field ID is there but the only place for the code is in the value and this just passes the code to the email and not the results.

Then I tried the Container element and it rendered it out on the form correctly but the email results were just blank.

I'm using a Plugin called Articles Anywhere and I'm trying to make it easy for my content providers to change dates/times and locations by using this code instead of going into the forms and editing them every time.

This is private content


It's the line of text just above the Submit button. Any ideas on how I can get this to work.

Thanks, Patrick
GreyHead 31 Dec, 2015
Hi Patrick,

What do you actually need to pass? You could add this string to the $form->data[''] array and set it as the value of a hidden input. Or, it might be simpler to pass the article ID - which I assume is available to you - and look up the date, time, etc. after the form submits.

Bob
Patrick007 05 Jan, 2016
I went with the Hidden element and it sorta works but the the actual message does not go with the email. Here's a screen shot of the form in debug mode.
[attachment=0]data_array.jpg[/attachment]

Here's the email array portion of the debug and it clearly shows the text message I want included. It's the green text "We will be looking forward to seeing you on:Thursday, February 18th at 12:00pm to 1:15pm"
[attachment=1]email_array.jpg[/attachment]

Here's a screen capture of the the email, the red arrow is pointing to where the message should be but instead the code I use is showing up instead. How do I get this to display the message not the code????
[attachment=2]email.jpg[/attachment]
GreyHead 06 Jan, 2016
Hi Patrick007,

There is something odd happening here. If the text is in the 'dummy' email in he Debugger then I would expect it to be exactly the same in the email that is sent. And I have no idea where the {article}. . .{/article} tag comes from - is that some kind of plug-in code that you are using?

Bob
GreyHead 07 Jan, 2016
Hi Patrick,

As far as I know ChronoForms has no support for plug-ins in the email template. It's possible that you could capture the content somehow in the form and copy that to a hidden input.

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