responsiv / campaign-plugin

[PREMIUM] Send professional campaign messages to your subscribers.
http://octobercms.com/plugin/responsiv-campaign
5 stars 2 forks source link

Possible to select recipients based on SQL condition #25

Closed kdoonboli closed 7 years ago

kdoonboli commented 7 years ago

Let's say I want to send customized user activity for those users who have been doing certain activity in the past week. Can I select recipients based on a SQL condition?

thanks

daftspunk commented 7 years ago

Yes. You can use the responsiv.campaign.getRecipientsData event to return different recipients every time. This method is called when the campaign is first launched. See the documentation on how to use this.

kdoonboli commented 7 years ago

UPDATE: Your solution above worked. I opened a new issue for the problem I'm facing now.

So I loaded my recipients dynamically with the way you suggested, but how can I pass a variable to the component that I placed in the page? e.g. the {email} variable of the recipient.

My component requires user's email to generate user's activity. This doesn't work:

{% component 'activity' userEmail=email%}

thanks