CIVICRM 3.4 Drupal 6 custom token is not inserted in automatic mailing but in manual it is

StackOverflow https://stackoverflow.com/questions/17063567

  •  31-05-2022
  •  | 
  •  

문제

Like in the title. I have a problem with my own custom token implemented via hook_civicrm_tokens and also hook_civicrm_tokenValues. When I try to send an email manualy, the token appears correctly in the list and it also appers parsed in the mail that the client recevies, the same with message templates expect that it appears as not parsed like {mycat.token}. It puzzles me because other tokens are inserted correctly in any case.

The code I've implemented looks something like this

function modulname_civicrm_tokens(&$tokens){
    $tokens['mytoken'] = array('mytoken.something' => 'token name');
}
function modulename_civicrm_tokenValues(&$values, $contactIDs){
    // some fancy logic for extracting data
    foreach ($contactIDs as $cid){
        $values[$cid]['mytoken.something'] = 'some data from other function connected with cid';
    }
}

Sorry if I messed up the code block.

Have enyone encountered this thing? Any tips how to fix this?

도움이 되었습니까?

해결책

Ok, I found out why this did not work. Somebody did a hack in a module that only used the template body from civicrm and send the message via mimemail so no wonder that it did not work .

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top