Commit 10713a70 authored by bgm's avatar bgm Committed by bgm
Browse files

Avoid try/catch, seems to cause issues with some error handlers

parent 23161faa
......@@ -58,20 +58,19 @@ class CivicrmMailerHTTPMailer extends \PHPMailer
}
if ($uf_id) {
try {
$uf = civicrm_api3('UFMatch', 'getsingle', [
'uf_id' => $uf_id,
]);
// The uf_match might not exist yet.
// For example: user account creation through a CiviCRM profile.
// This is OK, the code below will fetch by email.
$uf = civicrm_api3('UFMatch', 'get', [
'uf_id' => $uf_id,
'sequential' => 1,
]);
if (!empty($uf['values'][0])) {
$contact = civicrm_api3('Contact', 'getsingle', [
'id' => $uf['contact_id'],
'id' => $uf['values'][0]['contact_id'],
]);
}
catch (Exception $e) {
// The uf_match might not exist yet.
// For example: user account creation through a CiviCRM profile.
// This is OK, the code below will fetch by email.
}
}
// The user might not exist.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment