Download Mail plugin pre-sales question
I hope everybody had a wonderful summer!
A quick question about the Download Mail plugin:
Can I link emails to another table (example: "Applications" that users registered on the website and with attachments sent via emails to a selected and connected-with Download Mail plugin)?
Do I need to put some unique variable to the email subject so I can link each specific email with the related records?
Any help would be much appreciated,
The way I'd approach this is to create a plugin that runs a regular background task to look for downloaded mail and process any new items. To set up a background task, you would use the addCronJob() function, which would look something like this:
addCronJob('your_function_name_here', "Description of task", '* * * * * *');
This function will add a task to CMSB's Background Tasks, and will execute a function you specify in the first parameter at the interval specified in the 3rd parameter (learn more about cron interval formatting here: https://support.acquia.com/hc/en-us/articles/360004224494-Cron-time-string-format). Note that you'll also need to enable CMSB Background Tasks by setting up a cron job on your server - instructions for this can be found on the Background Tasks page, under Admin Menu.
Once you have the task running, you'll want to use the function to check for new downloaded mail records (in table "_incoming_mail" by default), determine if they need to be linked to another table, and update any necessary fields. The Incoming Mail table comes by default with a "processed" field, which you can update to track which mail records have already been checked by your function.
Let me know if you have any other questions!