Hello,
I have a Contact Form in V3 that will change the Dynamic Subject and the Dynamic To fields depending on what the user enters. I am trying to get the same functionality in V4.
Here is what I have done. In the email under On Submit I have set the following:
Under Static tab:
bcc: [email]test@domain.com[/email]
Under the Dynamic tab:
Dynamic To: toemail
Dynamic Subject: subject2
Dynamic From name: first_name
Dynamic From email: email
first_name and email are fields in the contact form. toemail and subject2 are just placeholders for replacing the field info.
I have added a Custom Code block which comes after the Captcha Check and before the Email block (described above). The mode is set to Controller. In the Custom Code block I have the following code:
Note in the above code I have changed to using domain.com and domain2.com from the real domains.
In the original V3 version bccemail was in the Dynamic bcc field, but V4 doesn't seem to have this.
The errors I get when I try to submit the form are:
Notice: Undefined index: subject2 in /home/xxx/public_html/administrator/components/com_chronoforms/form_actions/email/email.php on line 68
Notice: Undefined index: toemail in /home/xxx/public_html/administrator/components/com_chronoforms/form_actions/email/email.php on line 77
It looks like you can't access the dynamic email fields the same way in V4 as you could in V3. So, how do you change these fields now?
How do you redirect to a speific URL in V4 right now I can only see where you can put in a message on success in the "Show Thanks Message" block. I don't see a Redirect Block.
If it would help to have login access, please let me know and I can give that to you.
Thank you for your help on this.
I have a Contact Form in V3 that will change the Dynamic Subject and the Dynamic To fields depending on what the user enters. I am trying to get the same functionality in V4.
Here is what I have done. In the email under On Submit I have set the following:
Under Static tab:
bcc: [email]test@domain.com[/email]
Under the Dynamic tab:
Dynamic To: toemail
Dynamic Subject: subject2
Dynamic From name: first_name
Dynamic From email: email
first_name and email are fields in the contact form. toemail and subject2 are just placeholders for replacing the field info.
I have added a Custom Code block which comes after the Captcha Check and before the Email block (described above). The mode is set to Controller. In the Custom Code block I have the following code:
<?php
// Change the Subjects to have the site name in them
$name = JRequest::getString('first_name', '', 'post') . ' ' . JRequest::getString('last_name', '', 'post');
$subject = "Inquiry on UBC Department of Radiology from $name";
JRequest::setVar('subject2', $subject);
// Check for an doamin2 email address
$email = JRequest::getString('email', '', 'post');
if (strpos($email, '@domain2.com') === false) {
/**************************************************************************/
// This uses the Global Configuration EMAIL ADDRESS
/**************************************************************************/
$app = JFactory::getApplication();
JRequest::setVar('toemail', $app->getCfg( 'mailfrom' ));
JRequest::setVar('bccemail', 'bcc@domain.com');
} else {
// Found a domain2 email address, so change the To email address
JRequest::setVar('toemail', $email);
JRequest::setVar('bccemail', '');
}
?>
Note in the above code I have changed to using domain.com and domain2.com from the real domains.
In the original V3 version bccemail was in the Dynamic bcc field, but V4 doesn't seem to have this.
The errors I get when I try to submit the form are:
Notice: Undefined index: subject2 in /home/xxx/public_html/administrator/components/com_chronoforms/form_actions/email/email.php on line 68
Notice: Undefined index: toemail in /home/xxx/public_html/administrator/components/com_chronoforms/form_actions/email/email.php on line 77
It looks like you can't access the dynamic email fields the same way in V4 as you could in V3. So, how do you change these fields now?
How do you redirect to a speific URL in V4 right now I can only see where you can put in a message on success in the "Show Thanks Message" block. I don't see a Redirect Block.
If it would help to have login access, please let me know and I can give that to you.
Thank you for your help on this.