I’m just getting started with SuiteCRM and exploring its functions - I like it so far! But I have a question about automating email campaigns (using Workflows or otherwise).
What I want to achieve:
Send emails based on my email template to a list of prospects (‘targets’) - let’s call it list A
Wait for a while, let’s say 2 weeks
Send new emails based on another email template (follow-up emails) to the same target list except for those who have responded. If we denote repondents as R, then I want to be able to target a new list B = A / R.
How do I achieve it?
Is it possible to do with the builtin functionality of SuiteCRM, or should I look into implementing custom modules?
If you can build a new target list with just the ones who replied, then you can use that as a “suppression list” and re-send the campaign to the original list. The ones in the suppression list won’t be sent.
Another strategy is to make a target list with just the ones you want to send the second time. Have a look at the feature that lets you dump a Report (Reports module) as a Target List - this is quite a powerful way to filter and select.
Is there a built-in way of filtering target lists by ‘has replied’ criteria? I think any of the suggested solutions would work as long as there is a way to filter target lists based on whether they’ve replied to an email or not.
I tried looking into Reports Module and there seems to be a way to set up conditions for Email status == ‘Replied’, but I didn’t manage to get it to work so far.
My guess is that this ‘Replied’ status is only detected for emails authored by a user (admin or any of the registered SuiteCRM users), but what I want to achieve is to make sure the system detects email replies properly.
There’s probably a better field/attribute for filtering prospects based on their response, no? Perhaps I’m missing a simple (and intended) solution?
P.S.: In case if that matters, I have full control over the setup, so if there are any specific requirements for Outgoing Email / SMTP / Bounce handling email
I’m sorry, but I don’t really have an answer for you at that level of detail. I am not sure of what constitutes the “has replied” condition internally, in SuiteCRM.
I can perhaps give you a suggestion: you can have a Workflow react to some event (a new email, for example) and test a few conditions and set a simple boolean flag (my_has_replied) in the record. Then you can use that flag in the Report (or directly in a List view filter, which you can also use to Add to Target List.
Good luck, and tell us how you did it, if you succeed
It’s taken me a very long time to start figuring out how to get to the solution, and at some point I figured that inbound emails are not getting saved (imported) into the database properly.
As it turned out the issue was due to multiple inbound emails conflicting with each other (i.e. I had defined both a bounce handler and a personal email account for the same email).
So I ensured there’s only one inbound email box defined for my email address, and now the inbound emails are getting imported properly into the system.
With this now I’m able to generate reports on Emails module, but feeling lost in all the different fields that can be added to the reports… For example, what is Emails > Emails:Prospect > Campaign LogProspect List ID field? Trying to figure out if the system is smart enough to match inbound email’s “From” field with prospects.
If that’s the case, I’m confused about how the system tells which of the Prospect List’s to match the inbound emails to (assuming Prospect List is just another term for Target List, and that one Prospect may be included in different Prospect List’s)
Any hints would be of big help (to help me wrap my mind around this)!
After a long series of trials and errors I managed to get it to work. Thanks to @pgr for the ideas - I used them partially in my solution.
I ended up doing the following:
Set up a bounce-handling email account with auto-import option turned on (so that email hooks get triggered for each incoming message)
Define a custom logic hook for Emails module (as a file under /custom/Extension/modules/Emails/Ext/LogicHooks/) which gets triggered on after_save event;
The hook extracts “From” email address of the incoming email and looks up the prospect(s) with this email and marks them not to be disturbed again by adding them to the corresponding Suppression lists of the email campaigns they have previously been a part of.
Although not a perfect solution, it does exactly what I wanted it to
I’ll leave some useful code fragments here.
How to retrieve a list of all records (beans) with given email address?
You can further filter the $beans array by the object type you need (e.g. $bean instanceof Prospect).
How to create a new ProspectList for a given Campaign?
// map $campaign_id to the actual Campaign object
$campaign = BeanFactory::getBean( 'Campaigns', $campaign_id );
// ensure prospect lists data is loaded for this campaign
$campaign->load_relationship( 'prospectlists' );
// Create a new prospect list
$prospect_list = new ProspectList();
$prospect_list->name = '<some name here, e.g. $campaign->name . "some_suffix"';
$prospect_list->assigned_user_id = $assigned_user_id;
$prospect_list->list_type = "default"; // either 'default', 'test' or 'exempt'
// Add this list to the campaign