Exemple #1
0
	public function send_delmembermail( $user ) {
		$res = false;
		$phrase = wc2_get_option('phrase');
		$general = wc2_get_option('general');
		$delmem_customer_mail = isset( $phrase['delmem_customer_mail'] ) ? $phrase['delmem_customer_mail']: 1;
		$delmem_admin_mail = isset( $phrase['delmem_admin_mail'] ) ? $phrase['delmem_admin_mail']: 1;

		$name = wc2_localized_name(trim($user['name1']), trim($user['name2']));
		$subject = apply_filters( 'wc2_filter_send_delmembermail_subject', __('退会処理が完了しました。', 'wc2'), $user );
		$wc2_mail = WC2_Mail::get_instance();
		$wc2_mail->clear_column();

		if( $delmem_customer_mail ) {
			$message = $subject."\r\n\r\n";
			$message .= __('【登録情報】', 'wc2')."\r\n";
			$message .= '--------------------------------'."\r\n";
			$message .= __('Membership ID', 'wc2').' : '.$user['ID']."\r\n";
			$message .= __('アカウント', 'wc2') . ' : ' . $user['account'] . "\r\n";
			$message .= __('Name', 'wc2').' : '.sprintf(__('%s 様', 'wc2'), $name)."\r\n";
			$message .= __('メールアドレス', 'wc2').' : '. trim( $user['email'] ) ."\r\n";
			$message .= '--------------------------------'."\r\n\r\n";
			$message .= $phrase['footer']['membercomp'];
			$message = apply_filters( 'wc2_filter_send_delmembermail_message', $message, $user );

			$wc2_mail->set_customer_para_value( 'to_name', sprintf(__('%s 様', 'wc2'), $name) );
			$wc2_mail->set_customer_para_value( 'to_address', trim($user['email']) );
			$wc2_mail->set_customer_para_value( 'from_name', get_option('blogname') );
			$wc2_mail->set_customer_para_value( 'from_address', $general['sender_mail'] );
			$wc2_mail->set_customer_para_value( 'return_path', $general['sender_mail'] );
			$wc2_mail->set_customer_para_value( 'subject', $subject );
			$wc2_mail->set_customer_para_value( 'message', do_shortcode($message) );
			do_action('wc2_action_send_delmembermail_customer_para');

			$res = $wc2_mail->send_customer_mail();
		}

		if( $delmem_admin_mail ) {
			$message = $subject."\r\n\r\n";
			$message .= __('【登録情報】', 'wc2')."\r\n";
			$message .= '--------------------------------'."\r\n";
			$message .= __('Membership ID', 'wc2').' : '.$user['ID']."\r\n";
			$message .= __('アカウント', 'wc2') . ' : ' . $user['account'] . "\r\n";
			$message .= __('Kana', 'wc2').' : '.sprintf(__('%s 様', 'wc2'), $name)."\r\n";
			$message .= __('メールアドレス', 'wc2') . ' : '. trim( $user['email'] ) ."\r\n";
			$message .= '--------------------------------'."\r\n\r\n";
			$message = apply_filters( 'wc2_filter_send_delmembermail_notice', $message, $user );

			$wc2_mail->set_admin_para_value( 'to_name', __('会員削除通知', 'wc2') );
			$wc2_mail->set_admin_para_value( 'to_address', $general['order_mail'] );
			$wc2_mail->set_admin_para_value( 'from_name', 'Welcart Auto BCC' );
			$wc2_mail->set_admin_para_value( 'from_address', $general['sender_mail'] );
			$wc2_mail->set_admin_para_value( 'return_path', $general['sender_mail'] );
			$wc2_mail->set_admin_para_value( 'subject', $subject );
			$wc2_mail->set_admin_para_value( 'message', do_shortcode($message) );
			do_action('wc2_action_send_delmembermail_admin_para');

			$res = $wc2_mail->send_admin_mail();
		}
		return $res;
	}
Exemple #2
0
function wc2_get_addressform_confirm($entry_data, $type)
{
    $locale_options = wc2_get_option('locale_options');
    $system_options = wc2_get_option('system');
    $applyform = wc2_get_apply_addressform($system_options['addressform']);
    switch ($type) {
        case 'customer':
            $data = $entry_data['customer'];
            break;
        case 'delivery':
            $data = $entry_data['delivery'];
            break;
    }
    $formtag = '';
    $formtag .= wc2_custom_field_info($data, $type, 'head');
    if ($type == 'customer') {
        $formtag .= '
		<tr class="' . $type . '-mail"><th>' . __('E-mail address', 'wc2') . '</th><td>' . __($data['email']) . '</td></tr>';
    }
    switch ($applyform) {
        case 'JP':
            $formtag .= wc2_custom_field_info($data, $type, 'beforename');
            $formtag .= '
		<tr class="' . $type . '-name"><th>' . __('Full name', 'wc2') . '</th><td>' . esc_html($data['name1']) . ' ' . esc_html($data['name2']) . '</td></tr>';
            $kana = '
		<tr class="' . $type . '-phonetic"><th>' . __('Kana', 'wc2') . '</th><td>' . esc_html($data['name3']) . ' ' . esc_html($data['name4']) . '</td></tr>';
            $formtag .= apply_filters('wc2_filter_confirm_kana', $kana, $type, $data);
            $formtag .= wc2_custom_field_info($data, $type, 'aftername');
            $formtag .= '
		<tr class="' . $type . '-zipcode"><th>' . __('Postal Code', 'wc2') . '</th><td>' . esc_html($data['zipcode']) . '</td></tr>';
            if (count($system_options['target_market']) != 1) {
                $country = array_key_exists($data['country'], $locale_options['country']) ? $locale_options['country'][$data['country']] : '';
                $formtag .= '
		<tr class="' . $type . '-country"><th>' . __('Country', 'wc2') . '</th><td>' . esc_html($country) . '</td></tr>';
            }
            $formtag .= '
		<tr class="' . $type . '-pref"><th>' . __('Prefecture', 'wc2') . '</th><td>' . esc_html($data['pref']) . '</td></tr>
		<tr class="' . $type . '-address1"><th>' . __('City/Ward/Town/Village/Street name, street number', 'wc2') . '</th><td>' . esc_html($data['address1']) . '</td></tr>
		<tr class="' . $type . '-address2"><th>' . __('Building name, floor, room number', 'wc2') . '</th><td>' . esc_html($data['address2']) . '</td></tr>
		<tr class="' . $type . '-tel"><th>' . __('Phone number', 'wc2') . '</th><td>' . esc_html($data['tel']) . '</td></tr>
		<tr class="' . $type . '-fax"><th>' . __('FAX number', 'wc2') . '</th><td>' . esc_html($data['fax']) . '</td></tr>';
            break;
        case 'CN':
            $formtag .= wc2_custom_field_info($data, $type, 'beforename');
            $formtag .= '<tr class="' . $type . '-name"><th>' . __('Full name', 'wc2') . '</th><td>' . esc_html(wc2_localized_name($data['name1'], $data['name2'])) . '</td></tr>';
            $formtag .= wc2_custom_field_info($data, $type, 'aftername');
            if (count($system_options['target_market']) != 1) {
                $country = array_key_exists($data['country'], $locale_options['country']) ? $locale_options['country'][$data['country']] : '';
                $formtag .= '<tr><th class="' . $type . '-country">' . __('Country', 'wc2') . '</th><td>' . esc_html($country) . '</td></tr>';
            }
            $formtag .= '
		<tr class="' . $type . '-pref"><th>' . __('State', 'wc2') . '</th><td>' . esc_html($data['pref']) . '</td></tr>
		<tr class="' . $type . '-address1"><th>' . __('City/Ward/Town/Village/Street name, street number', 'wc2') . '</th><td>' . esc_html($data['address1']) . '</td></tr>
		<tr class="' . $type . '-address2"><th>' . __('Building name, floor, room number', 'wc2') . '</th><td>' . esc_html($data['address2']) . '</td></tr>
		<tr class="' . $type . '-zipcode"><th>' . __('ZIP code', 'wc2') . '</th><td>' . esc_html($data['zipcode']) . '</td></tr>
		<tr class="' . $type . '-tel"><th>' . __('Phone number', 'wc2') . '</th><td>' . esc_html($data['tel']) . '</td></tr>
		<tr class="' . $type . '-fax"><th>' . __('FAX number', 'wc2') . '</th><td>' . esc_html($data['fax']) . '</td></tr>';
            break;
        case 'US':
        default:
            $formtag .= wc2_custom_field_info($data, $type, 'beforename');
            $formtag .= '<tr class="' . $type . '-name"><th>' . __('Full name', 'wc2') . '</th><td>' . esc_html($data['name2']) . ' ' . esc_html($data['name1']) . '</td></tr>';
            $formtag .= wc2_custom_field_info($data, $type, 'aftername');
            $formtag .= '
		<tr class="' . $type . '-address2"><th>' . __('Building name, floor, room number', 'wc2') . '</th><td>' . esc_html($data['address2']) . '</td></tr>
		<tr class="' . $type . '-address1"><th>' . __('City/Ward/Town/Village/Street name, street number', 'wc2') . '</th><td>' . esc_html($data['address1']) . '</td></tr>
		<tr class="' . $type . '-pref"><th>' . __('State', 'wc2') . '</th><td>' . esc_html($data['pref']) . '</td></tr>';
            if (count($system_options['target_market']) != 1) {
                $country = array_key_exists($data['country'], $locale_options['country']) ? $locale_options['country'][$data['country']] : '';
                $formtag .= '<tr class="' . $type . '-country"><th>' . __('Country', 'wc2') . '</th><td>' . esc_html($country) . '</td></tr>';
            }
            $formtag .= '
		<tr class="' . $type . '-zipcode"><th>' . __('ZIP code', 'wc2') . '</th><td>' . esc_html($data['zipcode']) . '</td></tr>
		<tr class="' . $type . '-tel"><th>' . __('Phone number', 'wc2') . '</th><td>' . esc_html($data['tel']) . '</td></tr>
		<tr class="' . $type . '-fax"><th>' . __('FAX number', 'wc2') . '</th><td>' . esc_html($data['fax']) . '</td></tr>';
            break;
    }
    $formtag .= wc2_custom_field_info($data, $type, 'bottom');
    $res = apply_filters('wc2_filter_addressform_confirm', $formtag, $type, $data);
    return $res;
}