Closed RicardoRamirezR closed 4 years ago
Hello Ricardo
I did something similar using a Segment Class :
class DynamicActiveSubscribers extends Segment
{
public int $numMonths;
/**
* DynamicActiveSubscribers constructor.
* @param int $numMonths
*/
public function __construct(?int $numMonths)
{
$this->numMonths = $numMonths;
}
public function subscribersQuery(Builder $subscribersQuery): void
{
if($this->numMonths){
$subscribersQuery
->whereDate('subscribed_at', '>', Carbon::today()->subWeeks( config('myapp.active_subscribers.recent_weeks') )->toDateString())
->orWhereHas('opens', function (Builder $query) {
$query->whereDate('created_at', '>', Carbon::today()->subMonths( $this->numMonths )->toDateString()) ;
});
}
}
public function description(): string
{
return "DynamicActiveSubscribers ($this->numMonths months)";
}
}
That way, campaign can only be sent to users that recently subscribe OR that open a campaign in the last X months.
Mailcoach doesn't to automatic tagging on open and clicks, because everyone will likely want to do something else.
When installing into a Laravel app, you can leverage events and manually tagging to get your desired result.
https://mailcoach.app/docs/v2/package/advanced-usage/handling-events https://mailcoach.app/docs/v2/package/working-with-lists/working-with-tags
Hi there,
After sending a campaign, a group of subscribers should open the newsletter, Mailcoach will take care of registering the openings.
Now is the time for a campaign focused on that group of subscribers, it would be nice to have some way of putting a tag on them. (I've already did that at database label)