Egocentralis
Member
I have to rewrite some functionallity on the website but to achieve this i want to understand some things better. I have 2 places on the website where mails are being sended in different ways.
1)
One is in a list what creates a groupmail functionallity and this is using a plugin in the form called php. In this php code there is the code to send an email.. add recipients, send to address, subject, body, etc. The emails are sended at"End of form submission (onAfterProcess).
2)
The other one, is on a list where some financial details are combined in a table, and where the user can choose to send this details to the accountant. For this, there is a button to select yes or no and if selected yes, the email will be send to the accountant after saving the form. The plugin what is used in the form is the email plugin. It's triggered via a condition in the condition field like:
This plugin will send the email to the same accountant everytime because its an email address in the to field. I want to have this different.
__________________________
What I need is in situation 2 to write a query where there will be an email address selected belonging to the company of the employee who is making the financial table. So this email address will be dynamic since we have different companies and because of that different accountants.
Now i have different questions about this email plugin:
Can someone point me in the good direction??
1)
One is in a list what creates a groupmail functionallity and this is using a plugin in the form called php. In this php code there is the code to send an email.. add recipients, send to address, subject, body, etc. The emails are sended at"End of form submission (onAfterProcess).
2)
The other one, is on a list where some financial details are combined in a table, and where the user can choose to send this details to the accountant. For this, there is a button to select yes or no and if selected yes, the email will be send to the accountant after saving the form. The plugin what is used in the form is the email plugin. It's triggered via a condition in the condition field like:
Code:
return ("{g4e_orakel_uitbet_maak___mail_raw}" == "1");
__________________________
What I need is in situation 2 to write a query where there will be an email address selected belonging to the company of the employee who is making the financial table. So this email address will be dynamic since we have different companies and because of that different accountants.
Now i have different questions about this email plugin:
- in the to field there are two fields. Email to and email to (eval). Can i leave the email to field empty if I use the Email to (eval) field? So i can write the query for the dynamic choosen email adresses.
- In the options tab, I can give a from email address, and a reply to address and a subject. For this I need also a query since this information depends on what user/employee is sending the email to the accountant. I need to have the email address of the company of the employee who is submitting the form. For me, it looks like that fields are only for standard email addresses and not for queries like what is possible in the email to (eval) field. Is this correct? Or can i make a query somewhere what will take care of this information?
- In the php plugin what is sending the groupmails I have more or less the query i need to send the email to the different company accountants. I only have to change the content. But, can i replace the email plugin with the php plugin? For that I need the "start script" setting will use the condition
Code:
return ("{g4e_orakel_uitbet_maak___mail_raw}" == "1");
- In the php plugin, i have a query/code to add recipient, from name, etc. I have asked things about this in another topic. Is it possible to use this query / code in the email plugin?
Can someone point me in the good direction??