Reply To: Problem with sending emails


Home Forums Front End PM PRO Problem with sending emails Reply To: Problem with sending emails

#16160
test programmer
Participant

I now have the following:


add_filter( 'fep_eb_email_legends', 'fep_cus_fep_email_legends', 10, 3);

function fep_cus_fep_email_legends( $legends, $post, $user_email ){

    $user = get_user_by( 'email', $user_email );

    $language = get_user_meta( (int)$user->ID, 'icl_admin_language', true );

    $legends['receiver_language'] = array(
        'description' => __('Receiver language', 'front-end-pm'),
        'where' => array( 'newmessage', 'reply', 'announcement' ), //where this tag will be used
        'replace_with' => $language
    );

    return $legends;
}

add_filter( 'fep_eb_templates', 'fep_cus_fep_eb_templates', 10, 2 );

function fep_cus_fep_eb_templates( $templates, $where )
{
  $templates['new_message'] = 'Nieuw bericht';
  return $templates;
}

In my template I have the language by the added field receiver_language.

But how can I use this in my template in an if structure?

Is this the way I should do this?