This file contains 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_mymail_text_strings( $translated_text, $org_text, $domain ) { | |
if($domain != 'mymail') return $translated_text; | |
switch ( $org_text ) { | |
case 'Search for Text to Replace' : | |
$translated_text = 'Replace it with this text'; | |
break; | |
} | |
return $translated_text; | |
} |
This file contains 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
if ( function_exists( 'mymail_add_tag' ) ) { | |
function mytag_function($option, $fallback, $campaignID = NULL, $subscriberID = NULL){ | |
if(1 == $option){ | |
$link = 'http://exmaple.com/link1'; | |
}else if(2 == $option){ | |
$link = 'http://exmaple.com/link2'; | |
}else if(3 == $option){ | |
$link = 'http://exmaple.com/link3'; | |
} |
This file contains 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 add_custom_header_to_mymail($obj){ | |
$obj->add_header('X-Custom-Header', 'Custom Value'); | |
} | |
add_action('mymail_presend', 'add_custom_header_to_mymail'); |
This file contains 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_uppercase_name( $data ) { | |
if(isset($data['firstname'])) $data['firstname'] = ucwords($data['firstname']); | |
if(isset($data['lastname'])) $data['lastname'] = ucwords($data['lastname']); | |
return $data; | |
} | |
add_filter( 'mymail_verify_subscriber', 'my_uppercase_name' ); |
This file contains 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
add_filter( 'mailster_verify_subscriber', 'my_mailster_verify_subscriber' ); | |
function my_mailster_verify_subscriber( $entry ) { | |
//verify subscriber with custom methods | |
return $entry; | |
} | |
This file contains 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
add_filter( 'mailster_verify_subscriber', function( $entry ) { | |
if ( isset( $entry['firstname'] ) ) { | |
$names = explode( ' ', $entry['firstname'] ); | |
$entry['firstname'] = array_shift( $names ); | |
if ( ! empty( $names ) ) { | |
$entry['lastname'] = implode( ' ', $names ); | |
} | |
} |
This file contains 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 mailster_lists_only_unsubscribe($subscriber_id, $campaign_id){ | |
//unsubscribe user if campaign doesn't exists or isn't set | |
if(!mailster('campaigns')->get($campaign_id)) return; | |
$subscriber = mailster('subscribers')->get($subscriber_id); | |
if($subscriber){ | |
//change back to subscribed (silently) | |
mailster('subscribers')->change_status($subscriber_id, 1, true); | |
//get lists from the campaign |
This file contains 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
add_filter( 'mailster_form', 'change_mailster_form_html', 10 , 3 ); | |
function change_mailster_form_html( $html, $form_id, $form ) { | |
//do some replacements | |
return $html; | |
} |
This file contains 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 ){ | |
mailster('subscribers')->assign_lists($subscriber_id, $list_id, $remove_from_old_lists); | |
This file contains 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
add_filter( 'body_class', 'add_class_if_subscriber' ); | |
function add_class_if_subscriber( $classes ) { | |
$user_ID = get_current_user_id(); | |
$subscriber = mailster('subscribers')->get_by_wpid($user_ID); | |
if($subscriber){ | |
$classes[] = 'is-mailster-subscriber'; | |
} | |
return $classes; | |
} |
OlderNewer