I have a php application that has a user enter information in order to process approvals. Once the request is entered an email is sent to the manager for approval. My problem is that now they want me to send an email to both the manager and assistant manager and the director.
I CC the director but for both managers it has become a challenge.
Here are some details regarding the database that stores the information about the user:
- user first and last name
- user email
- user group
- user identifier if they are a manager
- user status (active or inactive)
What I want to do is run query that groups the users by group where the condition for manager is true and user status is active. Then loop and create one string value with all the values in the loop. Use this value as the "To" value in the php email part.
There is a possibility that more managers can be added to the groups so this loop would come in handy.
I have googled a few items on this and the implode function seems to be the way to go but i need a couple simple examples to learn from to use.
Does anybody have any examples.
I CC the director but for both managers it has become a challenge.
Here are some details regarding the database that stores the information about the user:
- user first and last name
- user email
- user group
- user identifier if they are a manager
- user status (active or inactive)
What I want to do is run query that groups the users by group where the condition for manager is true and user status is active. Then loop and create one string value with all the values in the loop. Use this value as the "To" value in the php email part.
There is a possibility that more managers can be added to the groups so this loop would come in handy.
I have googled a few items on this and the implode function seems to be the way to go but i need a couple simple examples to learn from to use.
Does anybody have any examples.
Comment