Forked from evrpress/Add user to list after click on link
          
        
    
          Created
          September 29, 2016 19:45 
        
      - 
      
- 
        Save ioniacob/e7f906bf01ee0676a226736ea1771ccb to your computer and use it in GitHub Desktop. 
    Assigns a subscriber to a certain list if a certain link has been clicked
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | function my_add_user_to_list_after_click_on_link ( $subscriber_id, $campaign_id, $target, $index ){ | |
| $link = 'http://example.com'; | |
| $list_id = 123; | |
| $remove_from_old_lists = false; | |
| if( $link == $target ){ | |
| mymail('subscribers')->assign_lists($subscriber_id, $list_id, $remove_from_old_lists); | |
| } | |
| } | |
| add_action( 'mymail_click', 'my_add_user_to_list_after_click_on_link', 10, 4); | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment