AcyMailing code triggers

This page lists the available code triggers used by AcyMailing

Triggers/hooks on specific actions

To be able to use AcyMailing triggers, you first need to create a custom add-on:

pageCustom add-on

Once created, you can add the following functions in your add-on's main file. They will be automatically called by AcyMailing if your add-on is active.

When the user is created

You can use these methods to execute specific actions before/after a user is created

 
public function onAcymBeforeUserCreate(&$user) {
// Your code here
}
public function onAcymAfterUserCreate(&$user) {
// Your code here
} 

When the user is modified

You can use these methods to execute specific actions before/after a user is modified

 
public function onAcymBeforeUserModify(&$user) {
// Your code here
}
public function onAcymAfterUserModify(&$user) {
// Your code here
} 

When the user is deleted

You can use these methods to execute specific actions before/after one or several users are deleted

 
public function onAcymBeforeUserDelete(&$users) {
// Your code here, $users is always an array of IDs
}
public function onAcymAfterUserDelete(&$users) {
// Your code here, $users is always an array of IDs
} 

When the user subscribes to a list

This method is called after the user subscribes to one or several lists

 
public function onAcymAfterUserSubscribe(&$user, $lists) {
// Your code here, $lists is always an array of list IDs
} 

When the user unsubscribes from a list

This method is called after the user unsubscribes from one or several lists

 
public function onAcymAfterUserUnsubscribe(&$userID, $lists) {
// Your code here, $lists is always an array of list IDs
} 

Last updated