[#28] Add parameter for preferred language and pass to XCM
This commit is contained in:
parent
ceb1f5a753
commit
36a756e4dd
2 changed files with 16 additions and 0 deletions
|
@ -177,6 +177,14 @@ class CRM_Twingle_Submission {
|
|||
}
|
||||
}
|
||||
|
||||
// Prepare values: language.
|
||||
if (!empty($contact_data['preferred_language'])) {
|
||||
$mapping = CRM_Core_I18n_PseudoConstant::longForShortMapping();
|
||||
// Override the default mapping for German.
|
||||
$mapping['de'] = 'de_DE';
|
||||
$contact_data['preferred_language'] = $mapping[$contact_data['preferred_language']];
|
||||
}
|
||||
|
||||
// Pass to XCM.
|
||||
$contact_data['contact_type'] = $contact_type;
|
||||
$contact = civicrm_api3('Contact', 'getorcreate', $contact_data);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue