how to make dynamic content of email and name

deepak13989 14 Jun, 2013
i want to make content of email and name dynamic..so when i use inbox to see emails of chronoform i find the user name and user email id..any help will be highly appreciated..Thanks in advance.
GreyHead 14 Jun, 2013
Hi deepak13989,

You can use the Dynamic ReplyTo Name and Email boxes in the Email action to do this.

Bob
deepak13989 14 Jun, 2013
thanks bob for reply..
i'm using joomla 3.0..is it possible to use dynamically function with this(joomla3.0)..
deepak13989 14 Jun, 2013
hi Bob Janes,,,
I need dynamic content for 'from name' and 'from email'. Is it possible to working with this.
Thanks for reply again
GreyHead 14 Jun, 2013
Hi deepak13989 ,

I strongly recommend that you do *not* use the Dynamic From Email element in your Email Setups. Using this often results in your emails being marked as spam and dropped into a spam filter. Instead use the static From Email with an address that matches the site domain name and use Dynamic ReplyTo Email for the user email. The result is the same but with a much better chance of good delivery.

Bob
deepak13989 14 Jun, 2013
thanks for reply bob...
i know that after using dynamic content for these function('reply to name' and 'reply to mail' or 'from name' or 'from email' ) results spam mail. My client says that it doesn't matter that where it comes..but there should be name and email of that person, on that mail...will you be pls help me to getting this out.actually i have worked on joomla 1.5, on that this was working fine...in joomla 3.0 it creates problem.
GreyHead 14 Jun, 2013
Hi deepak13989,

In Joomla! 3 there is a bug in the standard Email action; if you use my Email [GH] action that seems to be working OK.

Bob
jnendel 14 Jun, 2013
I am attempting to add a combination of dynamic context and text to my email subject. Is your custom Email [GH] action something I have to add? Also I didn't understand in the FAQ what was meant by "Drag a Custom Code action into the On Submit event and move it before the Email action". I don't see a Custom Code Action. I have Joomla 1.5.🤨
GreyHead 14 Jun, 2013
Hi jnendel,

Are you using the old ChronoForms v3? The FAQs are now all written for CFv4.

Bob
jnendel 14 Jun, 2013
So I upgraded to vs 4 and recreated the form but no matter what I do I cannot get dynamic input into the email subject. I installed the Email [GH] action and added custom code of:
<?php
$form->data['subject'] = "A guest has been registered at the {$form->data['Location']} location";
?>

right before the email send action. But it doesn't display the field data (and since I added the custom code I get debug info on the screen).
GreyHead 14 Jun, 2013
Hi jnendel,

Please drag a Debugger action into the On Submit event, then submit the form and post the debug - including the 'dummy emails' results here.

Note: if you are using the Easy Wizard you can turn on Debug on the Others tab.

Bob
deepak13989 17 Jun, 2013
Thanks bob for reply..i studied your Email [GH] function. but i didn't get that,,means what i have to do...should i have to change in core files or should i have to go for the file that you have attached in that page..
jnendel 17 Jun, 2013

So I upgraded to vs 4 and recreated the form but no matter what I do I cannot get dynamic input into the email subject. I installed the Email [GH] action and added custom code of:

<?php
$form->data['subject'] = "A guest has been registered at the {$form->data['Location']} location";
?>

right before the email send action. But it doesn't display the field data (and since I added the custom code I get debug info on the screen).



I was able to get a custom field containing a form data field and text, but I would like to also include the recordtime. When I add that to the custom data field like this:
<?php
$form->data['subject'] = "A guest has been authorized at the {$form->data['Location']} location on {$form->data['recordtime']}";
?>
I get a subject of "A guest has been authorized at the Strasburg location on".
GreyHead 17 Jun, 2013
Hi jnendel,

Have you set a value for $form->data['recordtime'] ?? if not that would explain the problem.

If you want to use the value saved in the database table then your Custom Code action needs to be after the DB Save action.

Bob
jnendel 18 Jun, 2013
I wasn't able to get the custom code solution to work so I used the (GH) Email action, placing it after the DB Save and in front of the first email action. I am trying to put the time stamp field of {cf_created} in the Subject. Here is the debug info:
Data Array:

Array
(
    [option] => com_chronoforms
    [chronoform] => Visitor_Authorization
    [event] => submit
    [Itemid] => 
    [Name] => Jerry Nendel
    [Company] => Sight & Sound Theatres
    [Location] => Strasburg
    [Authorized_By] => Jerry Nendel
    [Department] => House
    [input_submit_8] => Submit
    [577b4cf7355a946f7ca4f14f3528bc59] => 1
    [chronoform_data] => Array
        (
            [cf_uid] => edb1fd95272df8dcf6ab48f0123b3ed2
            [cf_created] => 2013-06-18 13:38:52
            [cf_created_by] => 0
            [cf_ipaddress] => 172.16.16.100
            [cf_user_id] => 0
            [option] => com_chronoforms
            [chronoform] => Visitor_Authorization
            [event] => submit
            [Itemid] => 
            [Name] => Jerry Nendel
            [Company] => Sight & Sound Theatres
            [Location] => Strasburg
            [Authorized_By] => Jerry Nendel
            [Department] => House
            [input_submit_8] => Submit
            [577b4cf7355a946f7ca4f14f3528bc59] => 1
            [cf_id] => 29
        )

    [chronoform_data_cf_id] => 29
    [subject] => A guest has been registered at the Strasburg location on 
    [IPADDRESS] => 172.16.16.100
)

Validation Errors:

Array
(
)

Debug Data

    Email info
        Email sent successfully
        From: (Jerry Nendel) Jerry.nendel@sight-sound.com
        Reply to: (Jerry Nendel) Jerry.nendel@sight-sound.com
        To: Jerry.nendel@sight-sound.com
        Subject: A guest has been authorized at the Strasburg location on {cf_created}
deepak13989 19 Jun, 2013
hi bob this is me again..i installed your file in chronoform but this doesn't solve my problem..should i have to do something else for this.
GreyHead 19 Jun, 2013
Hi jnendel,

If you look at the Debug output you'll see that the data you want is actually in $form->data['chronoform_data']['cf_created']. You can add that to your email either by adding {chronoform_data.cf_created} or, if necessary, <?php echo $form->data['chronoform_data']['cf_created']; ?>

Bob
GreyHead 19 Jun, 2013
Hi deepak13989,

I have no idea what isn't working for you. Please ask a specific question.

What exactly have you done and which part isn't working?

Bob
deepak13989 19 Jun, 2013
Thanks bob for you reply.. let start from begning.. i made a form on a website using chronoform. The site is in joomla 3.0.3. After successfully submitting the form the mail i received has not the functionality of 'reply to'. Means when i click on the mail for reply to it shows ' Root User [mailto:root@localhost] ' . i read your Email GH function and installed that but it doesn't help me.this is what my problem is..i want to make dynamic function that will generate reply to address for the particular user from where it came...
GreyHead 19 Jun, 2013
Hi deepak13989,

Please drag a Debugger action into the On Submit event, then submit the form and post the debug - including the 'dummy emails' results here.

Bob
jnendel 19 Jun, 2013
That did it! Thank you, thank you, thank you!
deepak13989 20 Jun, 2013
hi bob,
beacuse of i don't know how to drag a Debugger action into the On Submit event, i found a temprary solution for reply to mail functon. i just edit email.php file from admin/com_chronform. so that it will accept dynamic values from frontend when all the backend fields are empty.(by default it shows admin and [email]admin@admin.com[/email] in mail when all backend fields are empty). now this is working fine. but i want to your solution also..pls help me to getting this out professionally because i think my solution is not so good in programming manner.

how i can drag a debugger action into the On Submit event.

Thanks for Help
deepak13989 20 Jun, 2013
Hi bob,
i get that...below is my form debugger action..pls help
Data Array:


Array
(
    [chronoform] => form15
    [event] => submit
    [_selfname] => tester
    [email] => 
 tester@tester.com
    [input_submit_3] => Submit
    [3edfc023bd919cc2073c9a01261b35e2] => 1
    [chronoform_data] => Array
        (
            [cf_uid] => 7eccb379503318a1ce15969581dbefce
            [cf_created] => 2013-06-20 02:06:04
            [cf_created_by] => 0
            [cf_ipaddress] => 203.134.214.81
            [cf_user_id] => 0
            [chronoform] => form15
            [event] => submit
            [_selfname] => tester
            [email] => 
 tester@tester.com
            [input_submit_3] => Submit
            [3edfc023bd919cc2073c9a01261b35e2] => 1
            [cf_id] => 135
        )

    [chronoform_data_cf_id] => 135
)
Array
(
)
 Debug Data

    email
        10
            Result An email has been SENT successfully from (admin) admin@admin.com to deepak@jeronone.com	
            Body
            name 	tester
            email 	tester@tester.com


            Submitted by 203.134.214.81
            Attachments array ( )
GreyHead 20 Jun, 2013
Hi Deepak,

I find it very hard to understand what you are doing here. Is that Debugger output using your hacked code?

I don't see any sign that you have set a Reply To Name or Reply To Email?

Bob
deepak13989 20 Jun, 2013
hi bob
thanks for the fast reply. this is what i want to ask. what code or text should i have to set a Reply To Name or Reply To Email.

Deepak
deepak13989 20 Jun, 2013
hi bob,
This is what after set reply to name and reply to mail.


Data Array:

Array
(
    [chronoform] => form15
    [event] => submit
    [_selfname] => tester
    [email] => 
 tester@tester.com
    [input_submit_3] => Submit
    [3edfc023bd919cc2073c9a01261b35e2] => 1
    [chronoform_data] => Array
        (
            [cf_uid] => bb8e77d5d44c82c0634f1f8dbbe35709
            [cf_created] => 2013-06-20 03:51:18
            [cf_created_by] => 0
            [cf_ipaddress] => 203.134.214.81
            [cf_user_id] => 0
            [chronoform] => form15
            [event] => submit
            [_selfname] => tester
            [email] => 
 tester@tester.com
            [input_submit_3] => Submit
            [3edfc023bd919cc2073c9a01261b35e2] => 1
            [cf_id] => 160
        )

    [chronoform_data_cf_id] => 160
)

Validation Errors:

Array
(
)

Debug Data

    email
        10
            Result An email has been SENT successfully from (deepak) deepak@jeronone.com to deepak@jeronone.com	
            Body
            name 	tester
            email 	tester@tester.com


            Submitted by 203.134.214.81
            Attachments array ( )
GreyHead 20 Jun, 2013
Hi deepak13989,

And that is the standard Email action?

Bob
deepak13989 20 Jun, 2013
Hi Bob
Thanks for reply. i don't know about Standard Email Action. Will you please Elaborate it.

Deepak
GreyHead 20 Jun, 2013
Hi Deepak,

That's the Email action that is built in to ChronoForms; not the Email [GH] action??

Bob
deepak13989 21 Jun, 2013
Thanks bob for your reply
you mean to say Email tab action. The fields value i have given is the text name value generated by the "Email Template". Now reply to function is working fine with these value..but from name and from email is not working. If i use these fields as empty then from name and from email fields are admin and [email]admin@admin.com[/email]. But if i use some other value then it uses default value from library folder i.e. Root User and root@localhost.
deepak13989 21 Jun, 2013
Hi bob
i make some changes in php files so that this output comes..

Data Array:

Array
(
[chronoform] => form15
[event] => submit
[fromname] => geetanjali
[fromemail] =>
geetanjali@*******.com
[input_submit_3] => Submit
[ca80124127150e8d147a9ea19cf0e936] => 1
[chronoform_data] => Array
(
[cf_uid] => 17f2022489721cedef5fa9aa605966c3
[cf_created] => 2013-06-20 23:35:24
[cf_created_by] => 0
[cf_ipaddress] => 203.134.214.81
[cf_user_id] => 0
[chronoform] => form15
[event] => submit
[fromname] => geetanjali
[fromemail] =>
geetanjali@*******.com
[input_submit_3] => Submit
[ca80124127150e8d147a9ea19cf0e936] => 1
[cf_id] => 233
)

[chronoform_data_cf_id] => 233
)

Validation Errors:

Array
(
)

Debug Data

email
10
Result An email has been SENT successfully from (geetanjali) geetanjali@*****.com to deepak@******.com
Body
name geetanjali
email geetanjali@*****.com


Submitted by 203.134.214.81
Attachments array ( )





This shows that from name and from email is working fine here.But in when a mail comes it doesn't have the dynamic name as shown above.(Result An email has been SENT successfully from (geetanjali) geetanjali@******.com to deepak@******.com). It has its default joomla username and user email id i.e.(Root User and root@localhost)
deepak13989 23 Jul, 2013
hi bob its me again..


Data Array:

Array
(
    [chronoform] => form1
    [event] => submit
    [option] => com_chronoforms
    [view] => form
    [Itemid] => 1
    [_selfname] => tester
    [email] => deepak@jeronone.com
    [phone_no] => 12345
    [country] => Us
    [subject] => tester_subject
    [message] => tester_msg
    [input_submit_7] => Submit
    [b172b5e03d5a1eae7bfa1d69ccc347f1] => 1
    [chronoform_data] => Array
        (
            [cf_uid] => b1f409bb1308c9e618176fa46e2d0ce7
            [cf_created] => 2013-07-23 07:33:50
            [cf_created_by] => 0
            [cf_ipaddress] => 203.134.214.81
            [cf_user_id] => 0
            [chronoform] => form1
            [event] => submit
            [option] => com_chronoforms
            [view] => form
            [Itemid] => 1
            [_selfname] => tester
            [email] => deepak@jeronone.com
            [phone_no] => 12345
            [country] => Us
            [subject] => tester_subject
            [message] => tester_msg
            [input_submit_7] => Submit
            [b172b5e03d5a1eae7bfa1d69ccc347f1] => 1
            [cf_id] => 29
        )

    [chronoform_data_cf_id] => 29
)

Validation Errors:

Array
(
)

Thankyo.. you will be contact soon.
Debug Data

    email
        10
            Result An email has been SENT successfully from ({_selfname}){email} to geetanjali@jeronone.com,deepak@jeronone.com
            Body
            Name 	tester
            Email ID 	deepak@jeronone.com
            Phone No. 	12345
            Country 	Us
            Subject 	tester_subject
            Message 	tester_msg


            Submitted by 203.134.214.81
            Attachments array ( )

this is my present debugger. i want dynamic {_selfname} and {email} for "FROM NAME" and "FROM EMAIL". Please help. I have already installaed email Gh action.
GreyHead 27 Jul, 2013
Hi deepak13989,

You probably can't start an inptu name with an underscore so please rename _selfname to selfname.

Then you should be able to use {selfname} and {email} in the Reply To Name & Email boxes of the Email [GH] action (if you use the standard action then put selfname and email in the Reply To Name & Email boxes).

Bob

I strongly recommend that you do *not* use the Dynamic From Email element in your Email Setups. Using this often results in your emails being marked as spam and dropped into a spam filter. Instead use the static From Email with an address that matches the site domain name and use Dynamic ReplyTo Email for the user email. The result is the same but with a much better chance of good delivery.
deepak13989 06 Aug, 2013
hi bob,
i have a problem occurs while submitting.The submitted emails comes in inbox in outlook, but in gmail it comes in spam.So is there is any filter in chronoform to identify ip or any other which filtrate server side validation something..please help..its urgent.
This topic is locked and no more replies can be posted.