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_action( 'mailster_subscriber_subscribed', 'send_first_pregnancy_campaing' ); | |
function send_first_pregnancy_campaing( $subscriber_id ) { | |
//get subscriber | |
if ( $subscriber = mailster( 'subscribers' )->get( $subscriber_id ) ) { | |
$seachstring = "Pregnancy week %d"; | |
$total_weeks = 40; | |
//no birthdate |
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_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_custom_excerpt_length( $length ) { | |
return 20; | |
} | |
add_filter( 'mailster_excerpt_length', 'mailster_custom_excerpt_length', 999 ); |
OlderNewer