- David Goodale
- Jonathan Deitch
- Cindy Papenheim
Gammadyne Mailer can forward incoming email to members of a list in round-robin (rotating) fashion. For example, this is useful for distributing leads evenly among a sales team.
SetupFirst, create a new project (File menu > New Project). On the Incoming/Source branch, configure the source of the incoming emails.
On the Incoming/Processing branch, check the "No Recipients Required" box.
Next, enter the following code into the Incoming Script (on the Incoming/Scripts branch):
[[rem Fetch the global salesman index]]
[[var n = convert_to_number(file_fetch("c:\work\salesman_index.txt"))]]
[[rem Make sure the index is valid]]
[[if n < 0 or n >= 3]] [[let n = 0]] [[endif]]
[[rem Save the new incremented index]]
[[file_save("c:\work\salesman_index.txt", number_format(n + 1, ".0"))]]
[[rem Determine the appropriate salesman email address]]
[[var salesman_email = switchi(n, "firstname.lastname@example.org", "email@example.com", "firstname.lastname@example.org")]]
The last step is customizing the script to fit your situation:
- Replace both occurrences of "c:\work\salesman_index.txt" with an appropriate filepath on the hard drive. This file is used to hold the index of the next salesman to receive a forward. It can be named anything and can be located anywhere on the hard drive that you like. Be sure to create the directory if it does not already exist. The script will create the file the first time it runs.
- Change the "n >= 3" to reflect the number of salesmen.
- Replace the email addresses inside the switchi() function to the email addresses of all the salesmen.
TestingFirst, run the "Test POP3 Servers" tool to ensure that the mail server settings are correct. Then, enter a simple email on the Incoming/Source/Literal branch. Make sure the email includes a From: header. Here is an example:
This is a test.
Click the "Process Literal Email" button at the bottom of the Incoming/Source/Literal branch. The test email should be forwarded to the first salesman. Click the button again once for each other salesman, and once again so that the first salesman receives another test.
The final test is to send a series of emails to the forwarded email account.
DeploymentOnce the project has been tested, it is ready for deployment:
- On the Incoming branch, check the "Repeat Incoming Operation" box.
- On the Incoming/Processing branch, set "Delete Messages" to "When Processed".
- Save the project file someplace safe.
- Start the Incoming Operation by pressing F7, minimize Gammadyne Mailer, and let it run.
Note: to keep Gammadyne Mailer from taking up valuable space on the taskbar, go to the Window menu and check the "Minimize to Tray" box.