I'm using a combination of a submission form and an insert trigger for my mass email solution. The user will use the submission form to select which Department (or all employees) to send the email to. The Department field is a MultiSelect Dropdown, where the selections are being copied to a normal Text field so that the values can be used in a trigger. This text field shows the selected Department values split up by a ',' . They'll also enter the Subject and Message they want to include in the email.
Once submitted, the trigger will identify all users from my Employee_Table that should be included in the email from the submitted Department value. For each matching employee, it will add their email address to the toVariable variable. Once the loop is completed, it will send an email using the email block with the toVariable of all of the matching email addresses in the BCC section. This way, none of the users receiving the email can see anyone else's email address.
My problem is the character limit for BCC, which is 999 characters. When 'All Active Employees' is selected, only about half of the users receive the email due to the other email addresses being cut off from the character limit.
I'm looking for a solution to where I can still use the BCC function but be able to send the email to all matching email addresses. My first thoughts were to split the toVariable into multiple groups if the original toVariable was greater than 999 characters (such as, use a toVariable2 and toVariable3) and use those in an additional email block. However, I'm not sure how to split the toVariable at the end of an email address instead of cutting off in the middle of one in Triggers.
Another thought was to modify my submission form to query the Employee_Table and get the matching email addresses there, and use javascript to split the toVariables. However, there's an additional hurdle when doing it this way. My Department dropdown values aren't just departments, but also Job Category values. Departments are Office, Safety, Commercial, Commercial Service, and Residential. The Job Category values are Commercial Leads (Com - Lead), Commercial Service Leads (CS - Lead), and Residential Leads (Res - Lead). If "All Active Employees" is selected, it gets all employees in the table where "Active" equals True. My trigger already handles this, but for example if Commercial and Commercial Leads were both selected, the trigger will remove the Commercial Leads value to be looped through since they are already included in the Commercial department. But, it also makes it more difficult for using JavaScript because if Commercial is selected, it would need to query the Department column in Employee_Table to find Employees with a value of "Commercial", but if Commercial Leads was selected, it would need to query the Job_Category column to find Employees with a value of "Com - Lead".
Any thoughts on how to fix this issue are greatly appreciated!
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
Question
kpcollier
I'm using a combination of a submission form and an insert trigger for my mass email solution. The user will use the submission form to select which Department (or all employees) to send the email to. The Department field is a MultiSelect Dropdown, where the selections are being copied to a normal Text field so that the values can be used in a trigger. This text field shows the selected Department values split up by a ',' . They'll also enter the Subject and Message they want to include in the email.
Once submitted, the trigger will identify all users from my Employee_Table that should be included in the email from the submitted Department value. For each matching employee, it will add their email address to the toVariable variable. Once the loop is completed, it will send an email using the email block with the toVariable of all of the matching email addresses in the BCC section. This way, none of the users receiving the email can see anyone else's email address.
My problem is the character limit for BCC, which is 999 characters. When 'All Active Employees' is selected, only about half of the users receive the email due to the other email addresses being cut off from the character limit.
I'm looking for a solution to where I can still use the BCC function but be able to send the email to all matching email addresses. My first thoughts were to split the toVariable into multiple groups if the original toVariable was greater than 999 characters (such as, use a toVariable2 and toVariable3) and use those in an additional email block. However, I'm not sure how to split the toVariable at the end of an email address instead of cutting off in the middle of one in Triggers.
Another thought was to modify my submission form to query the Employee_Table and get the matching email addresses there, and use javascript to split the toVariables. However, there's an additional hurdle when doing it this way. My Department dropdown values aren't just departments, but also Job Category values. Departments are Office, Safety, Commercial, Commercial Service, and Residential. The Job Category values are Commercial Leads (Com - Lead), Commercial Service Leads (CS - Lead), and Residential Leads (Res - Lead). If "All Active Employees" is selected, it gets all employees in the table where "Active" equals True. My trigger already handles this, but for example if Commercial and Commercial Leads were both selected, the trigger will remove the Commercial Leads value to be looped through since they are already included in the Commercial department. But, it also makes it more difficult for using JavaScript because if Commercial is selected, it would need to query the Department column in Employee_Table to find Employees with a value of "Commercial", but if Commercial Leads was selected, it would need to query the Job_Category column to find Employees with a value of "Com - Lead".
Any thoughts on how to fix this issue are greatly appreciated!
Link to comment
Share on other sites
3 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.