Hello,
On Chronoforms V4, are we able to create groups of users.
Example:
Users 1 and 2 work in Office A
User 1
User 2
Users 3 and 4 work in Office B
User 3
User 4
Is there a way when creating a form,in the email settings, that we can send an email to a specific user depending on which office they work at?
If this makes no sense please let me know as it is quite hard to define.
Many Thanks in advance!!!
On Chronoforms V4, are we able to create groups of users.
Example:
Users 1 and 2 work in Office A
User 1
User 2
Users 3 and 4 work in Office B
User 3
User 4
Is there a way when creating a form,in the email settings, that we can send an email to a specific user depending on which office they work at?
If this makes no sense please let me know as it is quite hard to define.
Many Thanks in advance!!!
Hi MTP,
Yes you can do this, use a Dynamic To in the email set up with say email_to in it.
Then use a Custom Code block to set the value of email_to
Bob
Yes you can do this, use a Dynamic To in the email set up with say email_to in it.
Then use a Custom Code block to set the value of email_to
<?php
$user = JFactory::getUser();
// then get the User Group(s) - I don't know what this code is without looking it up
switch ( $user_group ) {
case 'group_1':
$form->data['email_to'] = 'some_user@example.com';
break;
case 'group_2':
$form->data['email_to'] = 'some_Other_user@example.com';
break;
}
?>
Bob
Hi,
Thanks for the coding. I just have one question about where it goes.
I am a little confused as I have some other coding that you have shown me in the Custom Code area already. Do I erase that coding with the above coding you have given me or can they both be put together as I want the above code to be put in the CC of the email on the form.
As I want the user to select their manager and whichever manager they select will send an email to the manager and CC to the managing partner of the office the manager is in if this makes sense?
Many Thanks again!
Thanks for the coding. I just have one question about where it goes.
I am a little confused as I have some other coding that you have shown me in the Custom Code area already. Do I erase that coding with the above coding you have given me or can they both be put together as I want the above code to be put in the CC of the email on the form.
As I want the user to select their manager and whichever manager they select will send an email to the manager and CC to the managing partner of the office the manager is in if this makes sense?
Many Thanks again!
Hi MTP<
You can put more than one piece of code in a Custom Code action; or you can add a second Custom Code action if you prefer to keep them separate.
You can use the same approach to set a Dynamic CC value.
Bob
You can put more than one piece of code in a Custom Code action; or you can add a second Custom Code action if you prefer to keep them separate.
You can use the same approach to set a Dynamic CC value.
Bob
Hello,
Thank you for the reply.
I was wondering on this coding:
in this part -['email_to'] is that where I put the email addresses of the group of users in the office?
Sorry about this I dont understand how and where you input the email addresses.
Thanks,
MTP
Thank you for the reply.
I was wondering on this coding:
<?php
$user = JFactory::getUser();
// then get the User Group(s) - I don't know what this code is without looking it up
switch ( $user_group ) {
case 'group_1':
$form->data['email_to'] = 'some_user@example.com';
break;
case 'group_2':
$form->data['email_to'] = 'some_Other_user@example.com';
break;
}
?>
in this part -['email_to'] is that where I put the email addresses of the group of users in the office?
Sorry about this I dont understand how and where you input the email addresses.
Thanks,
MTP
Hi MTP,
That will work with a single email address, I'm not sure if it works with a list of email addresses. There is another thread here that talks about that.
Bob
That will work with a single email address, I'm not sure if it works with a list of email addresses. There is another thread here that talks about that.
Bob
Hi,
thanks for the reply.
Whereabouts do the email addresses go in the code such as this:
(User 1 - submits form to manager)
(user 2 - manager)
case 'Group1':
$form->data['email_to'] = [email]'some_Other_user@example.com[/email]';
break;
Does the user 1 email address go in the email to box?
Sorry i dont understand much coding.
Thanks
MTP
thanks for the reply.
Whereabouts do the email addresses go in the code such as this:
(User 1 - submits form to manager)
(user 2 - manager)
case 'Group1':
$form->data['email_to'] = [email]'some_Other_user@example.com[/email]';
break;
Does the user 1 email address go in the email to box?
Sorry i dont understand much coding.
Thanks
MTP
Hi MTP,
If I understand what you are asking then email_to would go in the Dynamic To box in the Email setup.
Bob
If I understand what you are asking then email_to would go in the Dynamic To box in the Email setup.
Bob
Hi,
Thanks for the reply.
I have inserted the coding etc like you said and the grouping emails did not work.
Is there something I am doing wrong?
Thanks,
MTP
Thanks for the reply.
I have inserted the coding etc like you said and the grouping emails did not work.
Is there something I am doing wrong?
Thanks,
MTP
Hi MTP,
Based on Bob's code, you should have the string "email_to" in the "Dynamic To" field of your email AND you should have some field in your form passing the values "group_1" or "group_2".
You should also test your form first with a regular dynamic to field to make sure its emailing fine.
Regards,
Max
Based on Bob's code, you should have the string "email_to" in the "Dynamic To" field of your email AND you should have some field in your form passing the values "group_1" or "group_2".
You should also test your form first with a regular dynamic to field to make sure its emailing fine.
Regards,
Max
Hi,
Thanks for the reply.
I have the email to in the dynamic to box but I dont have group coding in my form as I didnt know I needed that.
How do I create a group field in my form?
Sorry for all the questions.
Thanks,
MTP
Thanks for the reply.
I have the email to in the dynamic to box but I dont have group coding in my form as I didnt know I needed that.
How do I create a group field in my form?
Sorry for all the questions.
Thanks,
MTP
Hi MTP,
Maybe you should have a dropdown (select box), give it the field name it "group", add 2 options:
group_1=Group 1
group_2=Group 2
And in bob's code, replace
Regards,
Max
Maybe you should have a dropdown (select box), give it the field name it "group", add 2 options:
group_1=Group 1
group_2=Group 2
And in bob's code, replace
switch ( $user_group ) {
withswitch ( $form->data['group'] ) {
Regards,
Max
Hi,
Thanks for the reply.
I have added the group coding etc and still the emails to the group email do not work.
Is there anything else I can do?
Thanks,
MTP
Thanks for the reply.
I have added the group coding etc and still the emails to the group email do not work.
Is there anything else I can do?
Thanks,
MTP
Hi MTP,
Hard to see where you've got to with this.
Please take a Form Backup using the icon in the Forms Manager and post it here (as a zipped file) or PM or email it to me and I'll take a closer look.
Bob
Hard to see where you've got to with this.
Please take a Form Backup using the icon in the Forms Manager and post it here (as a zipped file) or PM or email it to me and I'll take a closer look.
Bob
This topic is locked and no more replies can be posted.