listmonk
listmonk copied to clipboard
Send campaign to segment of list
This feature would allow using queries to send to a segment of a list. This is a pretty standard approach in email service providers. This is somewhat related to #129. The problem I see with creating dynamic "query lists" is that when someone wants to unsubscribe, they might only be unsubscribed from that list and not the "master" list.
To avoid this, I'd like to send a campaign to a segment. For example, I'll add a customer to the master list when they register and include a custom attribute with the subscribe date. Then I could send a campaign to a sub-segment who have registered in, for example, the last 30 days based on a SQL query. The campaign send would still be considered a part of the master list so that an unsubscribe would be unsubscribed from the master list.
Thanks for making listmonk! I've been looking for something like it for a long time.
Thanks @nickwynja.
The problem with creating a sub list based on a query is that the results can include subscribers from multiple lists, in which case, it would not be possible to have a single parent list.
I see. I think this could be managed by the segment being a sub-query just like is happening on /subscribers/lists/<id>
page now. When you query on that page, it appears to only be querying against the list. Here I can search for names or attributes and results are only showing members of the current list.
Thanks @nickwynja.
The problem with creating a sub list based on a query is that the results can include subscribers from multiple lists, in which case, it would not possible to have a single parent list.
Closing this as there's a longer discussion on the same matter here https://github.com/knadh/listmonk/issues/250.
@knadh In your comment, you referred to this (self) issue. Did you mean to refer to a different ticket or did you mean to comment and close a different ticket?
Please re-open this issue (or link to whatever issue is actually tracking this). It is still a needed feature and the linked discussion issue is ... self referential.
@nickwynja @alerque looks like I've lost track of the issue I really meant to reference, and now I'm unable to find it either. Re-opening this.
Would it be possible to do something here to filter the list based on a query/segment https://github.com/knadh/listmonk/blob/3386de40c74740b2577e5344e9f6456e9ba50502/queries.sql#L635-L637
WHERE subscriber_lists.status != 'unsubscribed' AND
## Either grab a query saves in a segments table or get camps.query directly
## Not sure if it's possible to convert the string into a real WHERE condition though
(SELECT query from segments WHERE id = camps.segment) AND
id > (SELECT last_subscriber_id FROM camps) AND
id <= (SELECT max_subscriber_id FROM camps)
Option would either be to store a new field query
directly in the campaign - so you would select a list
and an optional query
or have a new segments section which would store the query and allow you to view the count of subscribers. Maybe a segments could include the lists so when creating a campaign you would select either a list or a segment.
This would allow us to create separate campaigns for different regions (based on a subscriber attributes) but using a global list.
Yep, this is along the lines of the earlier discussions on using sub queries. Campaigns could have a query
field in the DB (and on the UI). This isn't trivial however. Right now, there's one global query that fetches subscribers in batches for all running campaigns. This will have to change to one query per campaign in addition to the query itself moving to string interpolation to include arbitrary per-campaign query expressions. That also brings in performance considerations.
I really hope segmentation will be added to Listmonk soon! it is a very important feature for any mailing software.
Any eta on list segments?
Our use case is the following: Our subscribers receive emails containing events based on their preferences by subscribing to a list. We have a job that runs everyday and populates each subscriber's "attribs" field with a list relevant events, but some days some subscribers may not have any events. Once the "attribs" field has been populated for all users , we create and start a new campaign. The problem we have is that we don't want subscribers to receive an email for a particular day if they don't have any events in their "attribs" property, and right now they are getting an email with no events.
I believe having a "query" property for each campaign will help with something like this. Right?
Do you have any other ideas as to how to implement this using listmonk?
I really hope segmentation will be added to Listmonk soon! it is a very important feature for any mailing software.
Any update here? Did you make some progress that could be engaged to contribute on code?
It's a must and I suspect that could be a major change on Listmonk scalating steps :)
Hi @satoshinotdead. Haven't started working on this yet.
There is a query as workaround to export and import while it's developed? My skills are limited but I like to try and learn.
And I chose to use open-source, all the way (moved from Mailerlite here).
- Create a temporary list
- Use the "Advanced" search to query and segment using SQL expressions. See docs.
- In the results, click on the table checkbox to check one or more subscribers. Use the "Manage lists" bulk option to add the users to the temporary list.
- Send campaign. Once done, delete the temporary list.
Thanks! I have readed before reply because it seems that specific query is not there.
Please, can you give an example about how can we check open or clicks for sample_campaign
from a SQL query to begineers?
Big kudos for Listmonk.
- Create a temporary list
- Use the "Advanced" search [...]
I've seen this suggestion a few times now. What about managing a list of SQL snippets/filter? So you would define a filter once, eg. select all subscribers which do / do-not have a custom attribute "telephone". And, in a campaign, you can optionally select a single filter which is then applied before send.
I am not sure if this will make implementing easier, but the snippets could be re-used throught the UI.