- // @todo - consider whether we really should be loading
- // this based on 'the first email in the db that matches'.
- // when we likely have the contact id. OTOH people probably barely
- // use preferredMailFormat these days - the good fight against html
- // emails was lost a decade ago...
- $preferredMailFormatArray = Email::get(FALSE)->addWhere('email', '=', $params['toEmail'])->addSelect('contact_id.preferred_mail_format')->execute()->first();
- $preferredMailFormat = $preferredMailFormatArray['contact_id.preferred_mail_format'] ?? 'Both';
-
- if ($preferredMailFormat === 'HTML') {
- $params['text'] = NULL;
- }
- if ($preferredMailFormat === 'Text') {
- $params['html'] = NULL;
- }