Campaign Manager
Send professional campaign messages to your subscribers.
Events
This plugin fires global events that can be useful for interacting with other plugins. Register event listeners in the boot method of your plugin registration file.
| Events | Description |
|---|---|
| responsiv.campaign.listRecipientGroups | Return an array of ['type-code' => 'Label'] to register recipient groups. See Recipient Groups. |
| responsiv.campaign.getRecipientsData | Return the recipients of a group, passed the $type code. See Recipient Groups. |
| responsiv.campaign.verification | A subscriber has confirmed their email address. Passed the $subscriber model. |
| responsiv.campaign.beforeUnsubscribe | Before a subscriber unsubscribes using a campaign email link. Passed the $component, $subscriber and $campaign. Return a response to replace the default behavior. |
| responsiv.campaign.unsubscribe | A subscriber has unsubscribed. Passed the $subscriber model. |
| responsiv.campaign.extendTagdata | Add shared data for mail tags. Passed the $tagData object by reference. See Mail Tags. |
| responsiv.campaign.renderForSubscriber | After a message is rendered for a subscriber. Passed the $campaign, the $result HTML by reference and the $subscriber. |
Here is an example of replacing the unsubscribe behavior with your own page.
Event::listen('responsiv.campaign.beforeUnsubscribe', function($component, $subscriber, $campaign) {
return Redirect::to('/preferences?email=' . urlencode($subscriber->email));
});
Here is an example of modifying the message content for each subscriber.
Event::listen('responsiv.campaign.renderForSubscriber', function($campaign, &$result, $subscriber) {
$result = str_replace('[[greeting]]', 'Hello ' . e($subscriber->first_name), $result);
});
Previous: User Registration